-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discrepancies between isort
and Ruff's I
lint check
#1718
Comments
Yeah this was sort of a known thing when I implemented it, but maybe that was a bad decision. (Both Ruff and isort should respect the version with the space, but Ruff doesn't respect the version without the space, IIUC.) |
I fixed the |
Thanks for the quick fix! A |
When you ran |
Ahh, sorry:
select = [
"E", # pycodestyle
"F", # Pyflakes
"W", # pycodestyle
# plugins:
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"PGH", # pygrep-hooks
"PLC", # pylint
"PLE", # pylint
"PLR", # pylint
"PLW", # pylint
"S", # flake8-bandit
"SIM", # flake8-simplify
"T10", # flake8-debugger
"UP", # pyupgrade
"RUF100", # yesqa
] |
Full Ruff section:[tool.ruff]
target-version = "py38" # Pin Ruff to Python 3.8
line-length = 95
exclude = [
'.git',
'.tox',
'.venv',
'tests/roots/*',
'build/*',
'doc/_build/*',
'sphinx/search/*',
'doc/usage/extensions/example*.py',
]
ignore = [
# pycodestyle
'E741',
# flake8-bugbear
'B006',
'B023',
# flake8-bugbear opinionated (disabled by default in flake8)
'B904',
'B905',
# pygrep-hooks
"PGH003",
# flake8-bandit
"S101", # assert used
"S105", # possible hardcoded password
"S113", # probable use of requests call without timeout
"S324", # probable use of insecure hash functions
# flake8-simplify
"SIM102", # nested 'if' statements
"SIM103", # return condition directly
"SIM105", # use contextlib.suppress
"SIM108", # use ternary operator
"SIM117", # use single 'with' statement
]
external = [ # Whitelist for RUF100 unkown code warnings
"E704",
"W291",
"W293",
"SIM110",
"SIM113",
]
select = [
"E", # pycodestyle
"F", # Pyflakes
"W", # pycodestyle
# plugins:
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"PGH", # pygrep-hooks
"PLC", # pylint
"PLE", # pylint
"PLR", # pylint
"PLW", # pylint
"S", # flake8-bandit
"SIM", # flake8-simplify
"T10", # flake8-debugger
"UP", # pyupgrade
"RUF100", # yesqa
] |
A |
Would that force Ruff to use the default settings (+ whatever's passed in on the command-line)? |
Ahh cool. Yes, seeing that now in Flake8. That would be straightforward to support. |
Tracking here: #1724. |
With regards to the above: I'm just gonna chalk it up to Ruff fixing other errors (like the unused |
Brilliant, thank you! A |
It seems Ruff expects a space after
isort:skip
(i.e. Ruff wantsisort: skip
), and Ruff seems to ignore F401 for the purposes of import sorting, whereasisort
honours them as skip markers(?).Ruff also reports 1 error in the initial call, yet the
--diff
call reports three errors.Ruff version 213; isort version 5.11.4
Sample file:
A
The text was updated successfully, but these errors were encountered: