Skip to content

Commit

Permalink
Enable unreachable_from_main linter rule (#4586)
Browse files Browse the repository at this point in the history
* Enable 'unreachable_from_main' linter rule

* Remove old debugging function too

* Sort linter rules
  • Loading branch information
parlough authored Jul 20, 2023
1 parent 9437471 commit 6eb836f
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 15 deletions.
1 change: 1 addition & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ linter:
- unnecessary_null_checks
- unnecessary_parenthesis
- unnecessary_statements
- unreachable_from_main
- use_if_null_to_convert_nulls_to_bools
- use_late_for_private_fields_and_variables
- use_setters_to_change_properties
Expand Down
11 changes: 0 additions & 11 deletions test/rule_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -179,17 +179,6 @@ void defineRuleUnitTests() {
});
}

/// Handy for debugging.
void defineSoloRuleTest(String ruleToTest) {
for (var entry in Directory(ruleTestDataDir).listSync()) {
if (entry is! File || !isDartFile(entry)) continue;
var ruleName = p.basenameWithoutExtension(entry.path);
if (ruleName == ruleToTest) {
testRule(ruleName, entry);
}
}
}

void testRule(String ruleName, File file,
{bool debug = true,
bool failOnErrors = true,
Expand Down
4 changes: 0 additions & 4 deletions tool/scorecard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,6 @@ class ScoreCard {
scores.forEach(f);
}

void removeWhere(bool Function(LintScore element) test) {
scores.removeWhere(test);
}

static Future<ScoreCard> calculate() async {
var lintsWithFixes = await _getLintsWithFixes();
var lintsWithAssists = await _getLintsWithAssists();
Expand Down

0 comments on commit 6eb836f

Please sign in to comment.