mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 22:03:31 +01:00
Add check-changes
rule for checking formatting of changes files.
Additional fixes to make the change work; - fix Python 2 vs 3 issues - fix some PEP 8 warnings - handle paths with numbers correctly - mention the make rule in doc/HACKING.
This commit is contained in:
parent
4ced3b59aa
commit
9dc90a5b7b
@ -111,6 +111,12 @@ check-logs:
|
|||||||
./scripts/maint/checkLogs.pl \
|
./scripts/maint/checkLogs.pl \
|
||||||
src/*/*.[ch] | sort -n
|
src/*/*.[ch] | sort -n
|
||||||
|
|
||||||
|
.PHONY: check-changes
|
||||||
|
check-changes:
|
||||||
|
@if test -d "$(top_srcdir)/changes"; then \
|
||||||
|
$(PYTHON) $(top_srcdir)/scripts/maint/lintChanges.py $(top_srcdir)/changes/*; \
|
||||||
|
fi
|
||||||
|
|
||||||
version:
|
version:
|
||||||
@echo "Tor @VERSION@"
|
@echo "Tor @VERSION@"
|
||||||
@if test -d "$(top_srcdir)/.git" && test -x "`which git 2>&1;true`"; then \
|
@if test -d "$(top_srcdir)/.git" && test -x "`which git 2>&1;true`"; then \
|
||||||
|
3
changes/feature15180
Normal file
3
changes/feature15180
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
o Minor features (testing):
|
||||||
|
- Add make rule `check-changes` to verify the format of changes files.
|
||||||
|
Closes ticket 15180.
|
@ -61,9 +61,10 @@ it's a bugfix, mention what bug it fixes and when the bug was
|
|||||||
introduced. To find out which Git tag the change was introduced in,
|
introduced. To find out which Git tag the change was introduced in,
|
||||||
you can use "git describe --contains <sha1 of commit>".
|
you can use "git describe --contains <sha1 of commit>".
|
||||||
|
|
||||||
If at all possible, try to create this file in the same commit where
|
If at all possible, try to create this file in the same commit where you are
|
||||||
you are making the change. Please give it a distinctive name that no
|
making the change. Please give it a distinctive name that no other branch will
|
||||||
other branch will use for the lifetime of your change.
|
use for the lifetime of your change. To verify the format of the changes file,
|
||||||
|
you can use "make check-changes".
|
||||||
|
|
||||||
When we go to make a release, we will concatenate all the entries
|
When we go to make a release, we will concatenate all the entries
|
||||||
in changes to make a draft changelog, and clear the directory. We'll
|
in changes to make a draft changelog, and clear the directory. We'll
|
||||||
|
@ -1,19 +1,22 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
from __future__ import with_statement
|
||||||
import sys
|
import sys
|
||||||
import re
|
import re
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
def lintfile(fname):
|
def lintfile(fname):
|
||||||
have_warned = []
|
have_warned = []
|
||||||
|
|
||||||
def warn(s):
|
def warn(s):
|
||||||
if not have_warned:
|
if not have_warned:
|
||||||
have_warned.append(1)
|
have_warned.append(1)
|
||||||
print fname,":"
|
print("{}:".format(fname))
|
||||||
print "\t",s
|
print("\t{}".format(s))
|
||||||
|
|
||||||
m = re.search(r'(\d{3,})', fname)
|
m = re.search(r'(\d{3,})', os.path.basename(fname))
|
||||||
if m:
|
if m:
|
||||||
bugnum = m.group(1)
|
bugnum = m.group(1)
|
||||||
else:
|
else:
|
||||||
@ -23,7 +26,7 @@ def lintfile(fname):
|
|||||||
contents = f.read()
|
contents = f.read()
|
||||||
|
|
||||||
if bugnum and bugnum not in contents:
|
if bugnum and bugnum not in contents:
|
||||||
warn("bug number %s does not appear"%bugnum)
|
warn("bug number {} does not appear".format(bugnum))
|
||||||
|
|
||||||
lines = contents.split("\n")
|
lines = contents.split("\n")
|
||||||
isBug = ("bug" in lines[0] or "fix" in lines[0])
|
isBug = ("bug" in lines[0] or "fix" in lines[0])
|
||||||
@ -44,7 +47,8 @@ def lintfile(fname):
|
|||||||
if re.search(r'[bB]ug (\d+)', contents):
|
if re.search(r'[bB]ug (\d+)', contents):
|
||||||
if not re.search(r'[Bb]ugfix on ', contents):
|
if not re.search(r'[Bb]ugfix on ', contents):
|
||||||
warn("bugfix does not say 'bugfix on X.Y.Z'")
|
warn("bugfix does not say 'bugfix on X.Y.Z'")
|
||||||
elif not re.search('[fF]ixes ([a-z ]*)bug (\d+); bugfix on ', contents):
|
elif not re.search('[fF]ixes ([a-z ]*)bug (\d+); bugfix on ',
|
||||||
|
contents):
|
||||||
warn("bugfix incant is not semicoloned")
|
warn("bugfix incant is not semicoloned")
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user