mirror of
https://github.com/zulip/zulip.git
synced 2025-10-27 10:03:56 +00:00
tools: Remove check-urls linter.
This commit removes `tools/check-urls`. It was added as a useful tool in preparation for the Django 1.10 migration. Since we completed that migration, it is no longer needed. Fixes #12180.
This commit is contained in:
committed by
Tim Abbott
parent
bc9d7141b2
commit
e01d3be1ba
@@ -1,29 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
|
|
||||||
|
|
||||||
def check_urls():
|
|
||||||
# type: () -> None
|
|
||||||
url_files = ['zproject/urls.py',
|
|
||||||
'zproject/dev_urls.py',
|
|
||||||
'zproject/legacy_urls.py',
|
|
||||||
'analytics/urls.py',
|
|
||||||
'zilencer/urls.py',
|
|
||||||
'corporate/urls.py']
|
|
||||||
|
|
||||||
pattern_1 = r"\s+\[?url\(.+,\s*'.+'\s*,\s*.*\)"
|
|
||||||
pattern_2 = r'\s+\[?url\(.+,\s*".+"\s*,\s*.*\)'
|
|
||||||
|
|
||||||
for url_file in url_files:
|
|
||||||
with open(url_file) as f:
|
|
||||||
data = f.read()
|
|
||||||
for pattern in (pattern_1, pattern_2):
|
|
||||||
r = re.search(pattern, data)
|
|
||||||
if r:
|
|
||||||
print('View should not be a string: {}'.format(r.group()))
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
check_urls()
|
|
||||||
@@ -96,7 +96,6 @@ def run():
|
|||||||
linter_config.external_linter('puppet-lint',
|
linter_config.external_linter('puppet-lint',
|
||||||
['puppet-lint'] + PUPPET_CHECK_RULES_TO_EXCLUDE, ['pp'])
|
['puppet-lint'] + PUPPET_CHECK_RULES_TO_EXCLUDE, ['pp'])
|
||||||
linter_config.external_linter('templates', ['tools/check-templates'], ['handlebars', 'html'])
|
linter_config.external_linter('templates', ['tools/check-templates'], ['handlebars', 'html'])
|
||||||
linter_config.external_linter('urls', ['tools/check-urls'], ['py'])
|
|
||||||
linter_config.external_linter('swagger', ['node', 'tools/check-swagger'], ['yaml'])
|
linter_config.external_linter('swagger', ['node', 'tools/check-swagger'], ['yaml'])
|
||||||
linter_config.external_linter('shellcheck', ['shellcheck', '-x'], ['sh'])
|
linter_config.external_linter('shellcheck', ['shellcheck', '-x'], ['sh'])
|
||||||
if not args.no_mypy:
|
if not args.no_mypy:
|
||||||
|
|||||||
Reference in New Issue
Block a user