-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
[ci] add yaml files linter to pre-commit hook but skip some rules for now (Part 1) #6763
base: master
Are you sure you want to change the base?
Conversation
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 for working on this! I just proposed a different approach, would like to hear your thoughts.
rev: v1.35.1 | ||
hooks: | ||
- id: yamllint | ||
args: ["--strict"] |
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.
This will be a bit disruptive to local development.. running pre-commit run --all-files
locally (which I do many times during local development)... will produce a lot of output and fail until we've fixed all the issues.
Would you consider the following instead?
- add all the rules that currently produce errors to
.yamllint.yml
in this PR with:disable
- remove the
SKIP=yamllint
inlint-python-bash.sh
- enable more and more rules over each of the next set of PRs.
That would prevent any new issues from being introduced on master
while allowing pre-commit run --all-files
to continue working locally.
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.
Makes sense! Thank you very much for the suggestion! I just pushed 4adf207 with these changes.
@borchero Could you please take a look when have time? |
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.
Thank you!
Trying to close-reopen for Azure restart. |
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! The approach outlined by @jameslamb (i.e. enable more rules in follow-up PRs) makes a lot of sense to me :)
First PR in series of PRs for linting yaml files.
See #6758 for background and future PRs' content required to fix all errors with the proposed config.
List of generated errors with the proposed config: https://github.com/microsoft/LightGBM/actions/runs/12383831332/job/34567296571#step:3:886.
List of available linter rules: https://yamllint.readthedocs.io/en/stable/rules.html.
Won't merge this PR without reviews from @borchero and @jameslamb (#6758 (comment)).