summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorcypherpunks <cypherpunks@torproject.org>2016-12-19 07:37:32 +0000
committerNick Mathewson <nickm@torproject.org>2017-01-11 09:16:19 -0500
commitfa0792c3a8e2f233efcebc8a89431ab9a1c877a2 (patch)
treedc52bb838431be7e037d9cfa1fba121dd9ddcd01 /scripts
parent730cc16b72db843cf40a6cb85d949b5d38fcb3c4 (diff)
downloadtor-fa0792c3a8e2f233efcebc8a89431ab9a1c877a2.tar.gz
tor-fa0792c3a8e2f233efcebc8a89431ab9a1c877a2.zip
Fix coding style issues in the changes file linter
Found using flake8 which gave the following output; lintChanges.py:10:13: E225 missing whitespace around operator lintChanges.py:25:1: E302 expected 2 blank lines, found 1 lintChanges.py:46:5: F841 local variable 'lines' is assigned to but never used lintChanges.py:52:32: E228 missing whitespace around modulo operator lintChanges.py:53:11: E201 whitespace after '(' lintChanges.py:56:41: E228 missing whitespace around modulo operator Part of ticket 21096.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/maint/lintChanges.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/scripts/maint/lintChanges.py b/scripts/maint/lintChanges.py
index b63a4eb3a1..3694c4b3c4 100755
--- a/scripts/maint/lintChanges.py
+++ b/scripts/maint/lintChanges.py
@@ -7,7 +7,7 @@ import re
import os
-KNOWN_GROUPS=set([
+KNOWN_GROUPS = set([
"Minor bugfix",
"Minor bugfixes",
"Major bugfix",
@@ -22,6 +22,7 @@ KNOWN_GROUPS=set([
"Code simplification and refactoring",
"Removed features"])
+
def lintfile(fname):
have_warned = []
@@ -43,17 +44,15 @@ def lintfile(fname):
if bugnum and bugnum not in contents:
warn("bug number {} does not appear".format(bugnum))
- lines = contents.split("\n")
-
m = re.match(r'^[ ]{2}o ([^\(:]*)([^:]*):', contents)
if not m:
warn("header not in format expected")
elif m.group(1).strip() not in KNOWN_GROUPS:
- warn("Weird header: %r"%m.group(1))
- elif ( ("bugfix" in m.group(1) or "feature" in m.group(1)) and
- ("Removed" not in m.group(1)) and
- '(' not in m.group(2)):
- warn("Missing subcategory on %s"%m.group(1))
+ warn("Weird header: %r" % m.group(1))
+ elif (("bugfix" in m.group(1) or "feature" in m.group(1)) and
+ ("Removed" not in m.group(1)) and
+ '(' not in m.group(2)):
+ warn("Missing subcategory on %s" % m.group(1))
if m:
isBug = ("bug" in m.group(1).lower() or "fix" in m.group(1).lower())