lint-all: Check for use of '== None'.

This commit is contained in:
Tim Abbott 2016-05-31 06:58:35 -07:00
parent 9a57176ad6
commit 41336f3782
2 changed files with 4 additions and 1 deletions

View File

@ -155,6 +155,9 @@ python_rules = [
{'pattern': "^\s+[#]\w",
'strip': '\n',
'description': 'Missing whitespace after "#"'},
{'pattern': "== None",
'exclude': 'tools/lint-all',
'description': 'Use `is None` to check whether something is None'},
{'pattern': ", [)]",
'description': 'Unnecessary whitespace between "," and ")"'},
{'pattern': "% [(]",

View File

@ -20,7 +20,7 @@ for arbitrarily complex validators. See ValidatorTestCase for example usage.
A simple example of composition is this:
check_list(check_string)('my_list', ['a', 'b', 'c']) == None
check_list(check_string)('my_list', ['a', 'b', 'c']) is None
To extend this concept, it's simply a matter of writing your own validator
for any particular type of object.