-
Notifications
You must be signed in to change notification settings - Fork 7.2k
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
yamllint: fix various yamllint warning #53449
Merged
stephanosio
merged 8 commits into
zephyrproject-rtos:main
from
fabiobaltieri:compliance-fixes
Jan 3, 2023
Merged
yamllint: fix various yamllint warning #53449
stephanosio
merged 8 commits into
zephyrproject-rtos:main
from
fabiobaltieri:compliance-fixes
Jan 3, 2023
Conversation
This file contains 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
Added an extra commit to drop few |
gmarull
previously approved these changes
Jan 3, 2023
stephanosio
requested changes
Jan 3, 2023
Fix all thruthy errors detected by yamllint: yamllint -f parsable -c .yamllint $( find -regex '.*\.y[a]*ml' ) | \ grep '(truthy)' This only accepts true/false for boolean properties. Seems like python takes all sort of formats: https://github.com/yaml/pyyaml/blob/master/lib/yaml/constructor.py#L224-L235 But the current specs only mention "true" or "false" https://yaml.org/spec/1.2.2/#10212-boolean Which is the standard yamllint config. Excluding codeconv and workflow files, as some are using yes/no instead in the respective documentation. Signed-off-by: Fabio Baltieri <[email protected]>
Fix all brackets errors detected by yamllint: yamllint -f parsable -c .yamllint $( find -regex '.*\.y[a]*ml' ) | \ grep '(brackets)' Default config is to have no spaces inside brackets, changed few documentation strings as well that refered to lists even though the linter does not care about those. Signed-off-by: Fabio Baltieri <[email protected]>
Fix all colons and commas errors detected by yamllint: yamllint -f parsable -c .yamllint $( find -regex '.*\.y[a]*ml' ) | \ grep '(brackets)' yamllint -f parsable -c .yamllint $( find -regex '.*\.y[a]*ml' ) | \ grep '(commas)' yamllint -f parsable -c .yamllint $( find -regex '.*\.y[a]*ml' ) | \ grep '(empty-lines)' Default config is no space before, one space after, max 2 empty lines. Signed-off-by: Fabio Baltieri <[email protected]>
Fix all hyphens errors detected by yamllint: yamllint -f parsable -c .yamllint $( find -regex '.*\.y[a]*ml' ) | \ grep '(hyphens)' Default config is only one space after the hyphen. Signed-off-by: Fabio Baltieri <[email protected]>
Fix all hyphens errors detected by yamllint: yamllint -f parsable -c .yamllint $( find -regex '.*\.y[a]*ml' ) | \ grep '(comments)' Default config would be to require two spaces after the start of the comment, proposing to keep it on 1, inline with the Linux binding config, that is: ``` - comments: - min-spaces-from-content: 1 ``` Signed-off-by: Fabio Baltieri <[email protected]>
Fix all comments-indentation errors detected by yamllint: yamllint -f parsable -c .yamllint $( find -regex '.*\.y[a]*ml' ) | \ grep '(comments-indentation)' This checks that the comment is aligned with the content. Signed-off-by: Fabio Baltieri <[email protected]>
Fix all line-length errors detected by yamllint: yamllint -f parsable -c .yamllint $( find -regex '.*\.y[a]*ml' ) | \ grep '(line-length)' Using a limit is set to 100 columns, not touching the commandlines in GitHub workflows (at least for now). Signed-off-by: Fabio Baltieri <[email protected]>
It's redundant and it's failing the compliance CI check. Signed-off-by: Fabio Baltieri <[email protected]>
42fef07
to
99a20be
Compare
Updated:
|
stephanosio
approved these changes
Jan 3, 2023
de-nordic
approved these changes
Jan 3, 2023
gmarull
approved these changes
Jan 3, 2023
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.
Fix most yamllint warnings from the config proposed in #53398 (with a few tweaks).
Fixes all: brackets, colons, commas, comments, empty-lines, hyphens, truthy
Left:
Config used:
Changed from #53398: added
min-spaces-from-content
and decided to apply truthy also in the CI files, going to updated that PR as well.Let me know what you think, happy to tweak the config but this seems reasonable to me.