Skip to content

Commit d65931d

Browse files
committed
Fix URL for rules JSON file source
The site-wwww repo renamed the `_data` directory to `data`. Refactor to a URI for better formatting.
1 parent d60429f commit d65931d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pkgs/lints/tool/gen_docs.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ import 'package:yaml/yaml.dart' as yaml;
1010
import 'package:http/http.dart' as http;
1111

1212
/// Source of truth for linter rules.
13-
const rulesUrl =
14-
'https://raw.githubusercontent.com/dart-lang/site-www/main/src/_data/linter_rules.json';
13+
final rulesUri = Uri.https(
14+
'raw.githubusercontent.com',
15+
'dart-lang/site-www/main/src/data/linter_rules.json',
16+
);
1517

1618
/// Local cache of linter rules from [rulesUrl].
1719
///
@@ -91,7 +93,7 @@ Future<Map<String, Map<String, String>>> _fetchRulesJson({
9193
final rulesJsonText = rulesJsonFile.readAsStringSync();
9294
return _readJson(rulesJsonText);
9395
}
94-
final rulesJsonText = (await http.get(Uri.parse(rulesUrl))).body;
96+
final rulesJsonText = (await http.get(rulesUri)).body;
9597
final rulesJson = _readJson(rulesJsonText);
9698

9799
// Re-save [rulesJsonFile] file.

0 commit comments

Comments
 (0)