lint: Require python3 shebangs.

This commit was originally from @fredfishgames, but it
needed a big rebase due to use letting it sit too long.
Also, we decided not to have shebangs at the top of test
files.
This commit is contained in:
Steve Howell 2017-12-12 07:05:41 -06:00
parent 28687f18ca
commit fd069dff82
23 changed files with 10 additions and 36 deletions

View file

@ -166,7 +166,11 @@ def build_custom_checkers(by_lang):
# and comments which should be rewritten to avoid use of "python2", "python3", etc.
{'pattern': 'python[23]',
'exclude': set(['tools/provision']),
'include_only': set(['zulip/', 'tools/', 'zulip_botserver/']),
'description': 'Explicit python invocations should not include a version'},
{'pattern': '#!/usr/bin/env python$',
'include_only': set(['zulip_bots/']),
'description': 'Python shebangs must be python3'},
{'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.',