mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 08:26:11 +00:00
lint: Prevent self: Any annotations.
We should omit these for mypy. For most class definitions, mypy doesn't need `Any`, and it provides no real useful info. For clever monkeypatches, you should provide a more specific type than `Any`.
This commit is contained in:
@@ -264,6 +264,10 @@ def build_custom_checkers(by_lang):
|
||||
'description': 'Missing space around "%"',
|
||||
'good_lines': ["'%s' % ('foo')", "'%s' % (foo)"],
|
||||
'bad_lines': ["'%s'%('foo')", "'%s'%(foo)"]},
|
||||
{'pattern': 'self: Any',
|
||||
'description': 'you can omit Any annotation for self',
|
||||
'good_lines': ['def foo (self):'],
|
||||
'bad_lines': ['def foo(self: Any):']},
|
||||
# This rule is constructed with + to avoid triggering on itself
|
||||
{'pattern': " =" + '[^ =>~"]',
|
||||
'description': 'Missing whitespace after "="',
|
||||
|
||||
Reference in New Issue
Block a user