-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
export 'package:github/src/const/language_color.dart'; #232
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -8,17 +8,19 @@ const _path = './lib/src/const/language_color.dart'; | |||||
const _url = 'https://raw.githubusercontent.com/' | ||||||
'github/linguist/master/lib/linguist/languages.yml'; | ||||||
|
||||||
Future main() async { | ||||||
Future<void> main() async { | ||||||
final response = await http.Client().get(_url); | ||||||
|
||||||
final yaml = loadYaml(response.body) as YamlMap; | ||||||
|
||||||
final stringBuffer = StringBuffer() | ||||||
..writeln('// GENERATED CODE - DO NOT MODIFY BY HAND') | ||||||
..writeln('// VERSION OF ${DateTime.now().toIso8601String()}') | ||||||
..writeln() | ||||||
..writeln('const languagesColor = <String, String>{'); | ||||||
..writeln('const kGitHubLanguageColors = <String, String>{'); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's keep the name the same as above whatever we end up deciding
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||||||
|
||||||
final map = yaml.value as YamlMap; | ||||||
|
||||||
final languages = map.keys.cast<String>().toList(growable: false)..sort(); | ||||||
|
||||||
for (var language in languages) { | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a note, but now that this file is being exported, the language color map is now considered part of the public API and should be non-breaking in future changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes!