Skip to content

Commit d196978

Browse files
stereotype441Commit Queue
authored andcommitted
[messages] Change check_all_yaml.dart to match lints ignoring case.
Now that lint name matching is case insensitive (https://dart-review.googlesource.com/c/sdk/+/465964), it makes sense for `check_all_yaml.dart` to ignore case when checking the contents of the file `pkg/linter/example/all.yaml`. This paves the way for a follow-up CL that will change the names declared in the linter to all lower case. Change-Id: I6a6a6964b0b6863fbbf9998f0333863e2c15f60d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/465990 Reviewed-by: Samuel Rawlins <[email protected]> Commit-Queue: Paul Berry <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent 3981c33 commit d196978

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pkg/linter/tool/checks/check_all_yaml.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ String? checkAllYaml() {
3434
return "Error: '$allYamlPath' does not have a 'linter' section.";
3535
}
3636

37-
var configuredRules = (linterSection['rules'] as YamlList?)?.cast<String>();
37+
var configuredRules = (linterSection['rules'] as YamlList?)
38+
?.cast<String>()
39+
.map((s) => s.toLowerCase())
40+
.toList();
3841
if (configuredRules == null) {
3942
return "Error: '$allYamlPath' does not have a 'rules' section.";
4043
}
@@ -55,7 +58,7 @@ String? checkAllYaml() {
5558
(r) =>
5659
!r.state.isDeprecated && !r.state.isInternal && !r.state.isRemoved,
5760
)
58-
.map((r) => r.name);
61+
.map((r) => r.name.toLowerCase());
5962

6063
var extraRules = <String>[];
6164
var missingRules = <String>[];

0 commit comments

Comments
 (0)