-
-
Notifications
You must be signed in to change notification settings - Fork 636
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
Bug Report: Pants-Ruff Import Order Bug #18410
Comments
This is just #15069 mapped onto |
Any news on this? This has been causing havoc with a new Pants-based monorepo implementation my company is slowly adopting 😬 Looks like #15069 was opened 2 years ago... is this something that is fixable? Or is there a workaround that works for ruff? Workarounds listed in #15069 don't seem to work for us. We tried adding all the source folders to the |
We also experienced a similar issue regarding:
and workarounded this by adding such errorneously detetced packages to There was another case in the past:
Here we have renamed |
We just needed to add the |
We were able to fix this by setting the ruff setting fix to |
Describe the bug
The bug shows up when running ruff, with the isort (I) rules enabled, through pants.
When running the
ruff --fix ...
command on a file with both a first and third party import (unsorted), the import order is changed as expected. However, when runningpants fmt fix lint ::
, which also runs ruff, the import order remains unchanged due to wrong distinction between first and third party dependencies. The expected behavior is for ruff to give the same result whether executed directly or through pants.Pants version
2.16.0.dev7
OS
Only tried this on linux (Ubuntu 22.10).
Additional info
A minimal example that shows the issue, how to reproduce it.
The issue can be mitigated by adding the source root entries in pants.toml to ruff.toml. Something like
However, having to specify the source roots in two places is not desirable.
The text was updated successfully, but these errors were encountered: