1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 13:05:09 +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:
Sam Atkins 2023-09-08 20:20:17 +01:00 committed by Sam Atkins
parent 9f4e057085
commit 2cb816ad69
2 changed files with 142 additions and 132 deletions

View file

@ -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));