Skip to content

Config file discovery incorrectly includes parent config #8858

@bersbersbers

Description

@bersbersbers

The docs read:

"any parent configuration files are ignored"

with a few exceptions, all of which do not apply in the following example (both files have a [tool.ruff] section, --config is not used, a config file is found in the filesystem hierarchy, and nothing is provided on the command line at all).

Still,

mkdir -p bug1/bug2
echo '[tool.ruff]' > bug1/pyproject.toml
echo 'select = ["ALL"]' >> bug1/pyproject.toml
echo '[tool.ruff]' > bug1/bug2/pyproject.toml
echo 'ignore = ["D203", "D212"]' >> bug1/bug2/pyproject.toml
cd bug1/bug2
ruff .

gives

warning: `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible. Ignoring `one-blank-line-before-class`.
warning: `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible. Ignoring `multi-line-summary-second-line`.

although one of each pair of rules is clearly disabled in bug1/bug2/pyproject.toml.

rm ../pyproject.toml 
ruff .

works fine, suggesting that the presence of the parent config does play a role although it should not.

ruff 0.1.5

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions