<#18411 Pants fails to discover ruff configuration...
# github-notifications
q
#18411 Pants fails to discover ruff configuration file when [tool.ruff] section is missing Issue created by siggi84 Describe the bug When the command
pants fmt fix lint ::
is run with a pyproject.toml file that only contains a ruff sub-section config (e.g. [tool.ruff.per-file-ignores]) and no top-level [tool.ruff] section, Pants fails to discover the configuration file and misses the configurations in the sub-section. Pants version 2.16.0.dev7 OS Ubuntu 22.10 Additional info A minimal example that reproduces the issue is available. It shows how the this bug causes a removal of an unused imports, even when the rule causing the removal should be disabled in a config sub-section. This issue is likely due to a simplistic config discovery mechanism, as indicated by this line of code pants/src/python/pants/backend/python/lint/ruff/subsystem.py Line 108 in </pantsbuild/pants/commit/c9def21de8a4f95d6929af227b605b3f1adfa9d2|c9def21> pantsbuild/pants