I am using flake8 and pylint via ALE in vim.
I know how to disable individual errors/warnings for each of these linters in their respective config files.
How can I keep the line-too-long
checks except for the shebang line at the start of the file (if present)?
If the first line is not a shebang line, it should still complain about too-long lines.
So if the max line length is 5 (for sake of example), with this file:
#!/run/stuff
x=3
print(x)
They should complain about the third line but not the first one.
But with this file:
x = 1 + 1 + 1
# Print the result
print(x)
It should complain about all three lines.
With thanks to Ian Stapleton Cordasco, I ended up submitting a patch to pycodestyle (which is used by flake8) to ignore the length of shebang lines.
So now to fix my ALE setup, I can replace the pycodestyle script my copy of flake8 is using with the latest version from GitHub, and disable line-too-long checks in pylint while leaving them on in flake8/pycodestyle. That way without modifying my scripts in any way I still get linting for line length everywhere else, without getting redundant warnings for long shebangs.