bots: Add linter rule to prevent open() calls.

Addresses #5395.
This commit is contained in:
Robert Hönig 2017-06-20 22:37:35 +02:00 committed by showell
parent fd41a481e4
commit d45d9c9ab5
1 changed files with 6 additions and 1 deletions

View File

@ -301,7 +301,12 @@ def build_custom_checkers(by_lang):
'exclude': set(['tools/lib/provision.py',
'tools/setup/setup_venvs.py',
'scripts/lib/setup_venv.py']),
'description': 'Explicit python invocations should not include a version'}
'description': 'Explicit python invocations should not include a version'},
{'pattern': '(^|\s)open\s*\(',
'description': 'open() should not be used in Zulip\'s bots. Use functions'
' provided by the bots framework to access the filesystem.',
'include_only': set(['api/bots/']),
'exclude': set(['api/bots/john/john.py'])},
]) + whitespace_rules
bash_rules = [
{'pattern': '#!.*sh [-xe]',