DcqConfig class
Reads and caches DCQ rule configuration from analysis_options.yaml.
Config is read from the dart_code_quality: top-level section:
dart_code_quality:
exclude:
- "**/*.g.dart"
rules:
avoid-long-files:
max-length: 200
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- allRulesEnabled ↔ bool
-
When true, isDisabledInProject always returns false.
getter/setter pair
Static Methods
-
findRoot(
String filePath) → String? -
Finds the package root by searching upward from
filePathforpubspec.yaml. Returns null if not found. -
forRule(
String ruleName, RuleContext context) → Map< String, Object?> -
Returns the config map for
ruleNamein the project containingcontext. -
isDisabledInProject(
String ruleName, String root) → bool -
Whether
ruleNameis disabled in the project atroot. -
readAllRuleConfigs(
{String? projectRoot}) → Map< String, Map< String, Object?> > -
readEnabledRules(
{String? projectRoot}) → Set< String> - Reads the set of enabled rule names at registration time. Uses the same resolution logic as readAllRuleConfigs.
-
shouldAnalyze(
String filePath, String ruleName, RuleContext context) → bool -
Returns whether
filePathshould be analyzed byruleName.