-
Couldn't load subscription status.
- Fork 1.6k
Description
The current documentation for the extend configuration option states:
"To resolve the current
pyproject.tomlfile, Ruff will first resolve this base configuration file, then merge in any properties defined in the current configuration file."
This description is misleading for lint.ignore and lint.select options, as their behavior depends on whether select is specified in the child configuration.
Actual Behavior:
- Without select in child config (code)
When select is not specified in the child config, rule_selections from parent and child configs are accumulated into a vector, not replaced.
# Parent config
[lint]
select = ["ALL"]
ignore = ["E501"]
# Child config
extend = "../ruff.toml"
[lint]
ignore = ["F401"]
# Result: Both E501 AND F401 are ignored (accumulated)- With select in child config (code)
When select is specified in the child config, it triggers a complete reset of select_set, and parent's ignore rules are not applied.
# Parent config
[lint]
select = ["ALL"]
ignore = ["E501"]
# Child config
extend = "../ruff.toml"
[lint]
select = ["EM", "TC"]
ignore = ["EM102", "TC001"]
# Result: Only EM102 and TC001 is ignored (parent's E501 is NOT ignored)