-
-
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? |
Signed-off-by: karan-palan <[email protected]>
Signed-off-by: karan-palan <[email protected]>
Signed-off-by: karan-palan <[email protected]>
842fb35
to
b0c7520
Compare
condition(const JSON &schema, const JSON &, const Vocabularies &vocabularies, | ||
const SchemaFrame &, const SchemaFrame::Location &, | ||
const SchemaWalker &, const SchemaResolver &) const | ||
-> SchemaTransformRule::Result override { |
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 think at this point you can simplify the condition by making it a one liner on a return
. That will make it easier to read, as we won't be reading negated conditionals
schema.assign(entry.first, entry.second); | ||
} | ||
} | ||
} else if (if_schema.is_boolean() && !if_schema.to_boolean()) { |
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 think this branch will be problematic. You are only keeping certain keywords like $schema
but we are not being exhaustive. There could be anchors, or any other thing too. Can we just check against this case in the condition? I think we would need another rule to properly handle this and many of its edge cases
Signed-off-by: karan-palan <[email protected]>
No description provided.