File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -402,7 +402,9 @@ def use_ruff(
402402 ):
403403 rule_config = _get_basic_rule_config ()
404404 for _tool in ALL_TOOLS :
405- rule_config |= _tool .get_rule_config ()
405+ tool_rule_config = _tool .get_rule_config ()
406+ if not tool_rule_config .empty and _tool .is_used ():
407+ rule_config |= tool_rule_config
406408 else :
407409 rule_config = RuleConfig ()
408410
Original file line number Diff line number Diff line change @@ -47,6 +47,17 @@ def get_all_ignored(self) -> list[Rule]:
4747 """Get all (project-scope) ignored rules."""
4848 return self .ignored + self .unmanaged_ignored
4949
50+ @property
51+ def empty (self ) -> bool :
52+ """Check if the rule config is empty."""
53+ return (
54+ not self .selected
55+ and not self .ignored
56+ and not self .unmanaged_selected
57+ and not self .unmanaged_ignored
58+ and not self .tests_unmanaged_ignored
59+ )
60+
5061 def __repr__ (self ) -> str :
5162 """Representation which omits empty-list fields."""
5263 args = []
You can’t perform that action at this time.
0 commit comments