Skip to content

overrides[].rules.circular-dependency: "off" should suppress whole cycles whose files all match the override glob. #255

@OmerGronich

Description

@OmerGronich

Problem

overrides[] is the natural place to silence a rule for a folder, but it is not honoured for circular-dependency. In crates/cli/src/check/rules.rs, per-file override resolution is applied to file-scoped issues (unused_files, unused_exports, unused_class_members, …), and circular_dependencies is only cleared by the top-level rules.circular_dependencies == Severity::Off check — so an overrides[] entry targeting a folder has no effect on cycles inside it.

fallow-ignore-file circular-dependency exists but must be added to every file in every cycle, which scales poorly for generated trees and framework-shaped cycles (page-object factories, codegen unions, ANTLR listener hierarchies). A whole-rule disable hides real cycles elsewhere.

Proposed solution

Treat circular-dependency like the other file-scoped issues in apply_rules:

A cycle is suppressed when every file in cycle.files resolves to Severity::Off for circular-dependency via overrides[].

Cycles that touch even one non-overridden file are still reported, preserving real-positive detection.

{
	"overrides": [
		{
			"files": ["src/generated/**"],
			"rules": {"circular-dependency": "off"}
		}
	]
}

A shorthand circularDependencies.ignore: ["src/generated/**"] (parallel to duplicates.ignore) would also work.

Alternatives considered

  1. fallow-ignore-file circular-dependency on each file — already supported, but requires editing every member of every cycle; impractical for generated trees.
  2. Whole-rule disable (rules.circular-dependency: "off") — too coarse; loses real cycles.
  3. Per-line suppression — does not exist for circular-dependency (schema note) and would still require editing every file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions