<#18410 Bug Report: Pants-Ruff Import Order Bug> I...
# github-notifications
q
#18410 Bug Report: Pants-Ruff Import Order Bug Issue created by siggi84 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 running
pants 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
Copy code
src = ["src/python"]
However, having to specify the source roots in two places is not desirable. pantsbuild/pants