mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 06:23:38 +00:00
linter: Remove unnecessary escape sequences in custom rules.
This commit is contained in:
@@ -213,7 +213,7 @@ def build_custom_checkers(by_lang):
|
||||
'description': 'Missing whitespace after ":"'},
|
||||
{'pattern': "':\w[^']*$",
|
||||
'description': 'Missing whitespace after ":"'},
|
||||
{'pattern': "^\s+[#]\w",
|
||||
{'pattern': "^\s+#\w",
|
||||
'strip': '\n',
|
||||
'description': 'Missing whitespace after "#"'},
|
||||
{'pattern': "assertEquals[(]",
|
||||
@@ -278,14 +278,14 @@ def build_custom_checkers(by_lang):
|
||||
See WRAPPER_COMMENT in test_helpers.py for details.
|
||||
'''},
|
||||
# Directly fetching Message objects in e.g. views code is often a security bug.
|
||||
{'pattern': '[^r][M]essage.objects.get',
|
||||
{'pattern': '[^r]Message.objects.get',
|
||||
'exclude': set(["zerver/tests",
|
||||
"zerver/lib/onboarding.py",
|
||||
"zilencer/management/commands/add_mock_conversation.py",
|
||||
"zerver/worker/queue_processors.py"]),
|
||||
'description': 'Please use access_message() to fetch Message objects',
|
||||
},
|
||||
{'pattern': '[S]tream.objects.get',
|
||||
{'pattern': 'Stream.objects.get',
|
||||
'include_only': set(["zerver/views/"]),
|
||||
'description': 'Please use access_stream_by_*() to fetch Stream objects',
|
||||
},
|
||||
@@ -303,7 +303,7 @@ def build_custom_checkers(by_lang):
|
||||
]),
|
||||
'description': 'Please use access_stream_by_*() to fetch Stream objects',
|
||||
},
|
||||
{'pattern': '[S]tream.objects.filter',
|
||||
{'pattern': 'Stream.objects.filter',
|
||||
'include_only': set(["zerver/views/"]),
|
||||
'description': 'Please use access_stream_by_*() to fetch Stream objects',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user