History

ci/lint: disable isort checks

The error message is completely incomprehensible and also inconsistent about whether it wants two newlines or just one after an import. Consider this python script: import sys sys.stdout.write("garbage") That passes the ruff isort check just fine. But this does not: import sys def fake_function(): sys.stdout.write("garbage") fake_function() This will fail. Why? Because there should be two newlines after imports but only for functions. This is because of PEP8 rules about blank lines, but this is not explained or referenced anywhere in output from the lint. You only get a cryptic "Import block is un-sorted or un-formatted" with some visual that isn't clear in what it's trying to communicate. Additionally, it seems to go a bit beyond PEP8 and also will fail if you have too many blank lines (i.e. more than 1) in certain cases if the succeeding line isn't a function or class definition. Furthermore consider this example: import os import sys from subprocess import check_output, DEVNULL This also fails the lint. Why? Because DEVNULL should come before check_output. Again, the lint doesn't explain this and you're left guessing what horrible formatting sin you committed. Considering the amount of time I wasted trying to even understand this and I still don't, just delete it. How are contributors supposed to understand what this lint wants when the project's own developers were confused by it. Please just alphabetically sort your python imports and don't do "from foo import *".

Dudemanguy committed 1 year ago

Commit d19bb081 parent 05ff82e1 file · +0 −1Browse files

Unified · Split

pyproject.toml+0−1
@@ -5,7 +5,6 @@ line-length = 100 · 4 unmodified lines
5select = [5select = [
6 "F", # pyflakes6 "F", # pyflakes
7 "E", "W", # pycodestyle7 "E", "W", # pycodestyle
8 "I", # pycodestyle
9 "N", # pep8-naming8 "N", # pep8-naming
10 "UP", # pyupgrade9 "UP", # pyupgrade
11 "A", # flake8-builtins10 "A", # flake8-builtins

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t