-
Notifications
You must be signed in to change notification settings - Fork 748
CPLYTM-876 - Include documentation and hints for YAML linting #13606
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
Conversation
The project is now checking YAML lint issues in CI tests and contributors may need to fix these issues when changing specific files. This commit provides hints to make this task much easier and simpler. Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
* Shall use the `.yml` vs `.yaml` for the file extension | ||
* Shall have one blank line between sections | ||
|
||
<details> |
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.
Nitpick: I would refrain from using the <details>
, I feel that it makes the content quite hidden or less visible.
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.
My intention was to not create noise in the Style Guide style, which is expected to be the first documentation a contributor will check once hitting the CI Lint test. I also considered to move this somewhere else, but it is a small content and a reference in Style Guide would still be necessary. Maybe we can make the summary more intuitive. For example: Hint: Linting Tools to check and fix lint issues
. WDYT?
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.
OK, thanks!
|
||
Use `yamlfix` to automatically fix lint issues | ||
```bash | ||
yamlfix -c yamlfix.toml <file> |
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 have tried it on multiple control files and it works great.
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
Code Climate has analyzed commit 0ff044e and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 61.9% (0.0% change). View more on Code Climate. |
Do you think we need add |
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.
LGTM. Tested locally.
Good question. I saw the most of the linters complain about this by default, so I had to explicitly disable this check here, but I think it would be good to gradually introduce it so yaml linters can be use with less customization in the future. |
Description:
The project is now checking YAML lint issues in CI tests and contributors may need to fix these issues when changing specific files. This commit provides hints to make this task much easier and simpler.
Rationale:
Review Hints:
You can try the command from the doc and see the outcomes.
Here is the
yamlfix
documentation:I used this tool to fix the lint issues in #13592