mirror of https://github.com/zulip/zulip.git
lint-all: Check for use of '== None'.
This commit is contained in:
parent
9a57176ad6
commit
41336f3782
|
@ -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': "% [(]",
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue