Open leahwicz opened 3 months ago
@mikealfare I listed what I found on each of the options for linters and formatters above and why I picked these 2. I didn't see too many other options that looked any different out there. Let me know if this is what you were hoping the for linter and formatter to achieve.
I know you mentioned kebab casing, capitalization, etc. standardizing as well but none of the formatters are enforcing things like that so we would have to look at some more extensive tooling if you want that kind of standard enforced.
@mikealfare I listed what I found on each of the options for linters and formatters above and why I picked these 2. I didn't see too many other options that looked any different out there. Let me know if this is what you were hoping the for linter and formatter to achieve.
I know you mentioned kebab casing, capitalization, etc. standardizing as well but none of the formatters are enforcing things like that so we would have to look at some more extensive tooling if you want that kind of standard enforced.
Thanks for the PR @leahwicz! I agree with your assessment above. I left two comments. Let me know your thoughts.
resolves #137
Problem
Have a linter and formatter for GitHub workflows
Solution
This is one possible solution after looking at a few possibilities here is a summary of my findings
Linter Options
check-yaml
@ https://github.com/pre-commit/pre-commit-hooks - we actually are already using this so unless we are looking for more from a linter, we have this coveredyamllint
@ https://github.com/adrienverge/yamllint - this is extremely configurable which is nice but it doesn't autofix the files for you and instead you have to manually do it which is a painFormatter Options
pretty-format-yaml
@ https://github.com/macisamuele/language-formatters-pre-commit-hooks - does the job for indentation and line width if that's the prime focus. Will autofix for the developer. Actually is nice with keeping quotations persistent if we want to enable that.yamlfmt
@ https://github.com/jumanjihouse/pre-commit-hook-yamlfmt - forces each file to start with---
which isn't really the style that we are currently abiding by unless we want to changeyamlfmt
@ https://github.com/google/yamlfmt (requires Go) - the Go setup seems overkill for nothing extraThis PR shows the top vote options enabled and their changes.
I have it only enabled for GitHub workflow files at the moment. I also had it format the
.pre-commit-config.yaml
file as well since it was all over the place. If we enable it for all YAML files then a bunch of the changie files will change which I'm not sure how that would impact changie at the moment.Checklist