summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDoug Hellmann <doug@doughellmann.com>2018-06-13 16:47:42 -0400
committerDoug Hellmann <doug@doughellmann.com>2018-06-13 16:50:07 -0400
commitf453a5f64c4534893e64e4a525c466edf01aae96 (patch)
treea3f74b2667f9cc6c5bddbb710607aab286036faa /tools
parentf51e726f643b65ee816dff66cc9a3c932c0bca23 (diff)
downloadtrove-f453a5f64c4534893e64e4a525c466edf01aae96.tar.gz
change pylint wrapper to let messages be prefixes
The messages for many of the errors reported by pylint have been extended to include "suggestions" (especially in the case of undefined variables or members). Rather than update all of the individual messages in the configuration file, just treat the messages as prefixes. Change-Id: I1f11c50e39dbd43c4a9b54ccaaccf03f5ff07aca Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/trove-pylint.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/trove-pylint.py b/tools/trove-pylint.py
index 785c4bf6..75cea908 100755
--- a/tools/trove-pylint.py
+++ b/tools/trove-pylint.py
@@ -136,13 +136,14 @@ class Config(object):
[filename, codename] in self.config['ignored_file_codes']):
return True
- fcm_ignore1 = [filename, code, message]
- fcm_ignore2 = [filename, codename, message]
for fcm in self.config['ignored_file_code_messages']:
- if fcm_ignore1 == [fcm[0], fcm[1], fcm[2]]:
- return True
-
- if fcm_ignore2 == [fcm[0], fcm[1], fcm[2]]:
+ if filename != fcm[0]:
+ # This ignore rule is for a different file.
+ continue
+ if fcm[1] not in (code, codename):
+ # This ignore rule is for a different code or codename.
+ continue
+ if message.startswith(fcm[2]):
return True
return False