StyleChecker class final
Runs style rules over Dart source.
It is also the way to test a custom rule:
final violations = StyleChecker([const NoPrintRule()])
.checkSource('lib/a.dart', "void f() => print('x');");
expect(violations.single.ruleId, 'no_print');
Constructors
-
StyleChecker(List<
StyleRule> rules) -
Creates a checker running
rules.const
Properties
Methods
-
checkSource(
String path, String content) → List< StyleViolation> -
Parses
content, the text of the file atpathrelative to the package root, and runs every rule on it. Violations suppressed by an// inspectra: ignore-stylecomment are left out. -
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