mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibWeb: Alphabetize property names in Properties.json
And add a check to make sure it stays that way!
This commit is contained in:
parent
9f4e057085
commit
2cb816ad69
Notes:
sideshowbarker
2024-07-17 03:35:16 +09:00
Author: https://github.com/AtkinsSJ
Commit: 2cb816ad69
Pull-request: https://github.com/SerenityOS/serenity/pull/20990
2 changed files with 142 additions and 132 deletions
|
@ -42,6 +42,16 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
VERIFY(json.is_object());
|
||||
auto properties = json.as_object();
|
||||
|
||||
// Check we're in alphabetical order
|
||||
DeprecatedString most_recent_name = "";
|
||||
properties.for_each_member([&](auto& name, auto&) {
|
||||
if (name < most_recent_name) {
|
||||
warnln("`{}` is in the wrong position in `{}`. Please keep this list alphabetical!", name, properties_json_path);
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
most_recent_name = name;
|
||||
});
|
||||
|
||||
replace_logical_aliases(properties);
|
||||
|
||||
auto generated_header_file = TRY(Core::File::open(generated_header_path, Core::File::OpenMode::Write));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue