-
Notifications
You must be signed in to change notification settings - Fork 46
New linter yamlfmt #1011
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
base: main
Are you sure you want to change the base?
New linter yamlfmt #1011
Conversation
⏱️ 13m total CI duration on this PR
|
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 for the contribution! I've left a few notes.
linters/yamlfmt/.yamlfmt.yaml
Outdated
@@ -0,0 +1,9 @@ | |||
exclude: |
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.
Some notes:
- I'm not sure it makes sense to exclude
trunk.yaml
by default - We already ignore lock files for all formaters
- We generally accept the defaults for each tool instead of being opinionated about style. The exception would be defaults to help the tool fit into the
trunk
ecosystem (ie, disable all formatting rules in a linter because we expect a user to run a separate formatter).
I would suggest deleting this 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.
Not ignoring trunk.yaml makes that this file will be reported always after trunk upgrade or other operations. I think it would be more safe to exclude it.
Other settings are more sane than the default which basically massacres YAML files by ie. removing empty lines. It would be better to leave it to improve the user experience.
If it doesn't convince you I can remove the config file. It would be just better to not enable the plugin by default if any YAML file exists.
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.
@det Removed
@det Do we miss anything else? |
This is a configuration for https://github.com/google/yamlfmt which is the fast YAML formatter that works with different settings, ie. can format arrays with Kubernetes-style (without indentation).