Skip to content

Commit

Permalink
Version 3.6.0-250.0.dev
Browse files Browse the repository at this point in the history
Merge 409bb14 into dev
  • Loading branch information
Dart CI committed Sep 13, 2024
2 parents 6c1e919 + 409bb14 commit 397309e
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 153 deletions.
2 changes: 1 addition & 1 deletion pkg/linter/test/doc_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ void main() {
// Doc generation reads the fix status map to associate fix status
// badges with rule documentation. Here we check one for sanity.
// If the file moves or format changes, we'd expect this to fail.
expect(fixStatusMap['prefer_single_quotes'], 'hasFix');
expect(fixStatusMap['LintCode.prefer_single_quotes'], 'hasFix');
});
});
}
18 changes: 7 additions & 11 deletions pkg/linter/tool/machine.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,16 @@ Future<String> getMachineListing(
{
'name': rule.name,
'description': rule.description,
'categories': categories[rule.name]?.toList(),
'categories': categories[rule.name]?.toList() ?? [],
'state': rule.state.label,
'incompatible': rule.incompatibleRules,
'sets': [
if (coreRules.contains(rule.name)) 'core',
if (recommendedRules.contains(rule.name)) 'recommended',
if (flutterRules.contains(rule.name)) 'flutter',
],
'fixStatus': fixStatusMap[rule.name] ?? 'unregistered',
'fixStatus':
fixStatusMap[rule.lintCodes.first.uniqueName] ?? 'unregistered',
'details': rule.details,
if (sinceInfo != null)
'sinceDartSdk': sinceInfo[rule.name]?.sinceDartSdk ?? 'Unreleased',
Expand All @@ -109,15 +110,10 @@ Map<String, String> readFixStatusMap() {
var contents = File(statusFilePath).readAsStringSync();

var yaml = loadYamlNode(contents) as YamlMap;
var fixStatusMap = <String, String>{};
for (var entry in yaml.entries) {
var code = entry.key as String;
if (code.startsWith('LintCode.')) {
fixStatusMap[code.substring(9)] =
(entry.value as YamlMap)['status'] as String;
}
}
return fixStatusMap;
return <String, String>{
for (var MapEntry(key: String code, :YamlMap value) in yaml.entries)
if (code.startsWith('LintCode.')) code: value['status'] as String,
};
}

Future<
Expand Down
Loading

0 comments on commit 397309e

Please sign in to comment.