-
-
Notifications
You must be signed in to change notification settings - Fork 7
Linter: create rules to add syntaxtical sugar when else is set to false #1897
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: karan-palan <[email protected]>
Signed-off-by: karan-palan <[email protected]>
Signed-off-by: karan-palan <[email protected]>
Signed-off-by: karan-palan <[email protected]>
Signed-off-by: karan-palan <[email protected]>
Signed-off-by: karan-palan <[email protected]>
@jviotti , any comments? |
schema.erase("else"); | ||
if (if_schema.is_object()) { | ||
for (const auto &entry : if_schema.as_object()) { | ||
if (!schema.defines(entry.first)) { |
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.
Can you add at least one test that covers this case?
|
||
auto transform(JSON &schema) const -> void override { | ||
const auto if_schema = schema.at("if"); | ||
schema.erase("if"); |
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.
I'm not sure this is 100% correct. If the parent schema contains certain properties and you thus didn't elevate them, then you cannot remove the if
? i.e. you have to only remove the if
if it is empty?
Can you add tests for this too?
No description provided.