mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
lint: Ban i18n usage under zerver/views/development.
This commit is contained in:
@@ -513,7 +513,7 @@ def build_custom_checkers(by_lang):
|
||||
'good_lines': [' from typing import List'],
|
||||
'bad_lines': ['from typing import List']},
|
||||
{'pattern': 'django.utils.translation',
|
||||
'include_only': set(['test/']),
|
||||
'include_only': set(['test/', 'zerver/views/development']),
|
||||
'description': 'Test strings should not be tagged for translation',
|
||||
'good_lines': [''],
|
||||
'bad_lines': ['django.utils.translation']},
|
||||
@@ -526,7 +526,7 @@ def build_custom_checkers(by_lang):
|
||||
'good_lines': ['return json_success()'],
|
||||
'bad_lines': ['return json_success({})']},
|
||||
{'pattern': r'\Wjson_error\(_\(?\w+\)',
|
||||
'exclude': set(['zerver/tests']),
|
||||
'exclude': set(['zerver/tests', 'zerver/views/development']),
|
||||
'description': 'Argument to json_error should be a literal string enclosed by _()',
|
||||
'good_lines': ['return json_error(_("string"))'],
|
||||
'bad_lines': ['return json_error(_variable)', 'return json_error(_(variable))']},
|
||||
@@ -535,10 +535,10 @@ def build_custom_checkers(by_lang):
|
||||
'description': 'Argument to json_error should a literal string enclosed by _()'},
|
||||
# To avoid JsonableError(_variable) and JsonableError(_(variable))
|
||||
{'pattern': r'\WJsonableError\(_\(?\w.+\)',
|
||||
'exclude': set(['zerver/tests']),
|
||||
'exclude': set(['zerver/tests', 'zerver/views/development']),
|
||||
'description': 'Argument to JsonableError should be a literal string enclosed by _()'},
|
||||
{'pattern': r'''\WJsonableError\(["'].+\)''',
|
||||
'exclude': set(['zerver/tests']),
|
||||
'exclude': set(['zerver/tests', 'zerver/views/development']),
|
||||
'description': 'Argument to JsonableError should be a literal string enclosed by _()'},
|
||||
{'pattern': r"""\b_\((?:\s|{}|{})*[^\s'")]""".format(PYSQ, PYDQ),
|
||||
'description': 'Called _() on a computed string',
|
||||
|
||||
Reference in New Issue
Block a user