Linter: create rules to add syntaxtical sugar when else is set to false#1897
Open
Karan-Palan wants to merge 12 commits intosourcemeta:mainfrom
Open
Linter: create rules to add syntaxtical sugar when else is set to false#1897Karan-Palan wants to merge 12 commits intosourcemeta:mainfrom
Karan-Palan wants to merge 12 commits intosourcemeta:mainfrom
Conversation
Signed-off-by: karan-palan <karanpalan007@gmail.com>
Signed-off-by: karan-palan <karanpalan007@gmail.com>
Signed-off-by: karan-palan <karanpalan007@gmail.com>
jviotti
reviewed
Jul 28, 2025
jviotti
reviewed
Jul 28, 2025
Signed-off-by: karan-palan <karanpalan007@gmail.com>
Signed-off-by: karan-palan <karanpalan007@gmail.com>
Signed-off-by: karan-palan <karanpalan007@gmail.com>
Contributor
Author
|
@jviotti , any comments? |
jviotti
reviewed
Aug 7, 2025
jviotti
reviewed
Aug 7, 2025
jviotti
reviewed
Aug 7, 2025
jviotti
reviewed
Aug 7, 2025
jviotti
reviewed
Aug 7, 2025
Signed-off-by: karan-palan <karanpalan007@gmail.com>
Signed-off-by: karan-palan <karanpalan007@gmail.com>
Signed-off-by: karan-palan <karanpalan007@gmail.com>
842fb35 to
b0c7520
Compare
jviotti
reviewed
Aug 15, 2025
| condition(const JSON &schema, const JSON &, const Vocabularies &vocabularies, | ||
| const SchemaFrame &, const SchemaFrame::Location &, | ||
| const SchemaWalker &, const SchemaResolver &) const | ||
| -> SchemaTransformRule::Result override { |
Member
There was a problem hiding this comment.
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
jviotti
reviewed
Aug 15, 2025
jviotti
reviewed
Aug 15, 2025
| schema.assign(entry.first, entry.second); | ||
| } | ||
| } | ||
| } else if (if_schema.is_boolean() && !if_schema.to_boolean()) { |
Member
There was a problem hiding this comment.
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 <karanpalan007@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.