@@ -48,8 +48,10 @@ void main(List<String> args) async {
4848  }
4949
5050  // Generate new documentation. 
51-   var  newRulesMarkdownContent = 
52-       _updateMarkdown (rulesMarkdownContent, rulesJson);
51+   var  newRulesMarkdownContent =  _updateMarkdown (
52+     rulesMarkdownContent,
53+     rulesJson,
54+   );
5355
5456  // If no documentation change, all is up-to-date. 
5557  if  (newRulesMarkdownContent ==  rulesMarkdownContent) {
@@ -59,8 +61,10 @@ void main(List<String> args) async {
5961
6062  /// Documentation has changed. 
6163   if  (verifyOnly) {
62-     print ('${rulesMarkdownFile .path } is not up-to-date (lint tables need to be ' 
63-         'regenerated).' );
64+     print (
65+       '${rulesMarkdownFile .path } is not up-to-date (lint tables need to be ' 
66+       'regenerated).' ,
67+     );
6468    print ('' );
6569    print ("Run 'dart tool/gen_docs.dart' to re-generate." );
6670    exit (1 );
@@ -79,8 +83,9 @@ void main(List<String> args) async {
7983/// 
8084/// If [verifyOnly]  is `true` , only reads the cached data back from 
8185/// [rulesCacheFilePath] . 
82- Future <Map <String , Map <String , String >>> _fetchRulesJson (
83-     {required  bool  verifyOnly}) async  {
86+ Future <Map <String , Map <String , String >>> _fetchRulesJson ({
87+   required  bool  verifyOnly,
88+ }) async  {
8489  final  rulesJsonFile =  _packageRelativeFile (rulesCacheFilePath);
8590  if  (verifyOnly) {
8691    final  rulesJsonText =  rulesJsonFile.readAsStringSync ();
@@ -91,8 +96,9 @@ Future<Map<String, Map<String, String>>> _fetchRulesJson(
9196
9297  // Re-save [rulesJsonFile] file. 
9398  var  newRulesJson =  [...rulesJson.values];
94-   rulesJsonFile
95-       .writeAsStringSync (JsonEncoder .withIndent ('  ' ).convert (newRulesJson));
99+   rulesJsonFile.writeAsStringSync (
100+     JsonEncoder .withIndent ('  ' ).convert (newRulesJson),
101+   );
96102
97103  return  rulesJson;
98104}
@@ -108,8 +114,8 @@ Map<String, Map<String, String>> _readJson(String rulesJsonText) {
108114  return  {
109115    for  (Map <String , Object ?> rule in  rulesJson)
110116      rule['name' ] as  String :  {
111-         for  (var  key in  relevantKeys) key:  rule[key] as  String 
112-       }
117+         for  (var  key in  relevantKeys) key:  rule[key] as  String , 
118+       }, 
113119  };
114120}
115121
@@ -121,7 +127,9 @@ Map<String, Map<String, String>> _readJson(String rulesJsonText) {
121127/// [rulesJson] , based on the list of rules in `lib/core.yaml`  and 
122128/// `lib/recommended.yaml` . 
123129String  _updateMarkdown (
124-     String  content, Map <String , Map <String , String >> rulesJson) {
130+   String  content,
131+   Map <String , Map <String , String >> rulesJson,
132+ ) {
125133  for  (var  ruleSetName in  ['core' , 'recommended' ]) {
126134    var  ruleFile =  _packageRelativeFile (p.join ('lib' , '$ruleSetName .yaml' ));
127135    var  ruleSet =  _parseRules (ruleFile);
@@ -134,7 +142,10 @@ String _updateMarkdown(
134142      continue ;
135143    }
136144    content =  content.replaceRange (
137-         rangeStart, rangeEnd, _createRuleTable (ruleSet, rulesJson));
145+       rangeStart,
146+       rangeEnd,
147+       _createRuleTable (ruleSet, rulesJson),
148+     );
138149  }
139150  return  content;
140151}
@@ -148,7 +159,9 @@ List<String> _parseRules(File yamlFile) {
148159
149160/// Creates markdown source for a table of lint rules. 
150161String  _createRuleTable (
151-     List <String > rules, Map <String , Map <String , String >> lintMeta) {
162+   List <String > rules,
163+   Map <String , Map <String , String >> lintMeta,
164+ ) {
152165  rules.sort ();
153166
154167  final  lines =  [
@@ -166,15 +179,18 @@ String _createRuleTable(
166179/// The row should have the same number of entires as the table format, 
167180/// and should be on a single line with no newline at the end. 
168181String  _createRuleTableRow (
169-     String  rule, Map <String , Map <String , String >> lintMeta) {
182+   String  rule,
183+   Map <String , Map <String , String >> lintMeta,
184+ ) {
170185  final  ruleMeta =  lintMeta[rule];
171186  if  (ruleMeta ==  null ) {
172187    stderr.writeln ("WARNING: Missing rule information for rule: $rule " );
173188  }
174-   final  description =  (ruleMeta? ['description' ] ??  '' )
175-       .replaceAll ('\n ' , ' ' )
176-       .replaceAll (RegExp (r'\s+' ), ' ' )
177-       .trim ();
189+   final  description = 
190+       (ruleMeta? ['description' ] ??  '' )
191+           .replaceAll ('\n ' , ' ' )
192+           .replaceAll (RegExp (r'\s+' ), ' ' )
193+           .trim ();
178194  final  hasFix =  ruleMeta? ['fixStatus' ] ==  'hasFix' ;
179195  final  fixDesc =  hasFix ?  '✅'  :  '' ;
180196
0 commit comments