Skip to content

Commit

Permalink
Update rules.json and adjust test. (#4627)
Browse files Browse the repository at this point in the history
* Adjust message

* try json

* fix
  • Loading branch information
srawlins authored Aug 1, 2023
1 parent bd49571 commit b69163a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions test/verify_machine_json_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ import 'package:test/test.dart';
import '../tool/machine.dart';

void main() {
test('ensure `rules.json` is up to date', () async {
test("ensure 'rules.json' is up to date", () async {
var rulesFilePath = path.join('tool', 'machine', 'rules.json');
var onDisk = File(rulesFilePath).readAsStringSync();
var generated = await generateRulesJson();
expect(generated, onDisk, reason: '''`rules.json` is out of date.
Regenerate by running `dart tool/machine.dart -w`
''');
expect(
generated,
onDisk,
reason: "'rules.json' is out of date. Regenerate by running "
'`dart tool/machine.dart -w`',
);
});
}
2 changes: 1 addition & 1 deletion tool/machine/rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -2610,7 +2610,7 @@
"state": "stable",
"incompatible": [],
"sets": [],
"fixStatus": "noFix",
"fixStatus": "hasFix",
"details": "Top-level members and static members in an executable library should be used\ndirectly inside this library. An executable library is a library that contains\na `main` top-level function or that contains a top-level function annotated with\n`@pragma('vm:entry-point')`). Executable libraries are not usually imported\nand it's better to avoid defining unused members.\n\nThis rule assumes that an executable library isn't imported by other files\nexcept to execute its `main` function.\n\n**BAD:**\n\n```dart\nmain() {}\nvoid f() {}\n```\n\n**GOOD:**\n\n```dart\nmain() {\n f();\n}\nvoid f() {}\n```\n\n",
"sinceDartSdk": "2.19.0"
},
Expand Down

0 comments on commit b69163a

Please sign in to comment.