-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
linters+testdata: Reformat all yaml testcases for linting. #6511
linters+testdata: Reformat all yaml testcases for linting. #6511
Conversation
b3eb934
to
416fa37
Compare
With an intentional commit left in that had a trailing spaces error, it looks like the new "YAML Lint" target correctly finds the issue. |
416fa37
to
7e20bad
Compare
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.
Looks good to me, but if there are changes not related to quoting of whitespace I may very well have missed them. Since contributors often add tests to these files, it would be good to add this requirement to the development docs, and explain how to run the linter locally.
Thanks for taking a look @anderseknert! I agree that the linting process would be great to add to the docs-- fighting a linter in CI can be very frustrating. I'll go add the "run it yourself" process to the contributor docs tomorrow. 😄 |
✅ Deploy Preview for openpolicyagent ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
I've added an extra step to That should reduce the need for contributors to have a Python3 toolchain set up locally, but maybe it makes more sense to just add a separate |
I've separated out YAML linting into its own Makefile target: |
56ded7f
to
d6a0c28
Compare
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!
This commit adds a config for yamllint, as well as mass-reformats all of the existing Yaml testcases to pass linting. A few careful exceptions and ignores were added to the config to allow keeping existing Yaml files with minimal reformatting. Signed-off-by: Philip Conrad <philipaconrad@gmail.com>
Signed-off-by: Philip Conrad <philipaconrad@gmail.com>
Signed-off-by: Philip Conrad <philipaconrad@gmail.com>
Signed-off-by: Philip Conrad <philipaconrad@gmail.com>
This commit moves the YAML linting logic in the Makefile to be under the new `check-yaml-tests` target, so that the `make check` target does not mix Go and YAML errors together. Signed-off-by: Philip Conrad <philipaconrad@gmail.com>
Signed-off-by: Philip Conrad <philipaconrad@gmail.com>
e7f87ac
d6a0c28
to
e7f87ac
Compare
Signed-off-by: Philip Conrad <philipaconrad@gmail.com>
Will merge when CI goes green. 👍 |
This PR adds a config for yamllint, as well as mass-reformats all of the existing Yaml testcases to pass linting. A few careful exceptions and ignores were added to the config to allow keeping our existing Yaml files with minimal manual reformatting.
The PR also will include an update to the GH Actions checks done during pull requests, ensuring we'll continue to get well-formatted Yaml files for our testcases in the future. 🙂
Note: All formatting seen in this maintenance PR was done by adding
---
document starts where needed, and utilizing the Prettier auto-formatter for Yaml on all of the files. Manual fixups were then done for whatever issues remained, like "trailing spaces" linter errors.