Skip to content
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

isort incompatible with ruff? #13

Closed
vivbak opened this issue Jan 31, 2024 · 2 comments · Fixed by #14
Closed

isort incompatible with ruff? #13

vivbak opened this issue Jan 31, 2024 · 2 comments · Fixed by #14
Assignees

Comments

@vivbak
Copy link

vivbak commented Jan 31, 2024

There were linting issues in the following PR https://github.com/populationgenomics/transfer-private/pull/47

Specifically

pre-commit run --files clear_test_dataset_on_metamist.py                                                                                                                                                               
check yaml...........................................(no files to check)Skipped
fix end of files.........................................................Passed
trim trailing whitespace.................................................Passed
check for case conflicts.................................................Passed
check for merge conflicts................................................Passed
detect private key.......................................................Passed
debug statements (python)................................................Passed
check for added large files..............................................Passed
markdownlint.........................................(no files to check)Skipped
isort (python)...........................................................Failed
- hook id: isort
- files were modified by this hook

Fixing /Users/vivian/Desktop/Code/transfer-private/thousand-genomes/clear_test_dataset_on_metamist.py

black....................................................................Passed
ruff.....................................................................Failed
- hook id: ruff
- files were modified by this hook

Found 1 error (1 fixed, 0 remaining).

mypy.....................................................................Passed 

Basically, isort is incompatible with ruff. The modifications to the files as a result of isort will subsequently cause failures in ruff and vice versa.

@MattWellie
Copy link
Collaborator

Hah, catastrophic. I guess the fix is seeing if ruff supports all the primary/secondary configs and just using ruff's isort implementation, or skipping the ruff isort checks
https://docs.astral.sh/ruff/settings/#isort

@illusional
Copy link
Contributor

Ooh yeah, sorry I noticed this in a related PR for tob-wgs: populationgenomics/tob-wgs#173, but hadn't had time to PR back. This is also partially related to the --fix add in the pre-commit, something we probably don't want to do for ruff (despite our other hooks modifying in place) - as that's not the default behaviour off other type checking tools.

I've added a PR #14 to address this, and unrelated will follow-up with directions on adding a new cpg-id-checker: populationgenomics/pre-commits#1

@illusional illusional self-assigned this Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants