-
Notifications
You must be signed in to change notification settings - Fork 38
fix(policy): policy devel lint --format removes the comments #2325
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
fix(policy): policy devel lint --format removes the comments #2325
Conversation
Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
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.
Awesome, do you mind explaining a little bit more about how you solved the issue?
Do you think it's ok to remove protoyaml? I remember something like it had built-in validation (the annotations in the yaml files) of the proto object, I guess we've lost that?
"skipped": skipped, | ||
"violations": violations, | ||
"skip_reason": skip_reason, | ||
"skipped": skipped, |
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.
why do we have more spaces now?
Do ew want to have 4 instead of 2? I personally like 2 spaces, any reason for using 4?
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.
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.
seems like a bug, must have missed this, thanks!
Protoyaml is still used so the validation is present. The issue was solved with another library that allows unmarshaling yaml into yaml nodes and then traversing those nodes to update only the embedded policies. This adds some overhead because yaml gets unmarshaled twice when |
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.
Thanks, let's make sure we keep two spaces
This PR solves problem with comments being removed when
--format
is used.Example policies in docs were re-linted with the tool.
Closes #2320