Is there a way to add a notice, similar to a PEP8 notice, if the first line in a .py file isn't #!/usr/bin/env python3?
Like how if I have a line > 80 characters, it notifies me? I'd like that same type of reminder to add the shebang to the top:
Is there a way to add a notice, similar to a PEP8 notice, if the first line in a .py file isn't #!/usr/bin/env python3?
Like how if I have a line > 80 characters, it notifies me? I'd like that same type of reminder to add the shebang to the top:
for what it's worth, most python files shouldn't have a shebang -- you only want that for executable scripts (you don't really want most library modules to be executable for example)
the only linter that I know of that attempts to handle this sort of thing is
check-executables-have-shebangsfrompre-commit-hooks-- this linter will alert you if an executable text file does not start with a shebang (it's not specific to python because the problem itself is not specific to python)the linter itself isn't really useful outside of
pre-commithowever as it depends on the framework properly detecting "text files" and "has the executable bit set" -- there may be a sublime integration for the framework but I'm not familiar with itdisclaimer: I'm the author of
pre-commit-hooksandpre-commitabove (as well as one of the maintainers ofpyflakes-- though the warning above is actually coming frompycodestyle)