chore(deps): update pre-commit hook google/yamlfmt to v0.20.0 #516
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.
This PR contains the following updates:
v0.17.2→v0.20.0Note: The
pre-commitmanager in Renovate is not supported by thepre-commitmaintainers or community. Please do not report any problems there, instead create a Discussion in the Renovate repository if you have any questions.Release Notes
google/yamlfmt (google/yamlfmt)
v0.20.0Compare Source
Features
-versionflag works when usinggo installThe previous method of version retrieval only worked when downloading the binary through GitHub releases or one of the community-made packages. When using
go install, the version would always bedevbecause theldflagsweren't being used to set the version. It now falls back todebug.BuildInfoso that the version will be displayed properly when installing through this method.Fixes
Performance Issues when formatting large files
Details in #283. Two fixes were submitted:
strings.Repeatinstead of manually looping during string construction #284If you have experienced similar performance issues, these fixes should help.
Contributors
Thanks @artur-beznosyuk-verkada for the performance issue analysis and the
strings.Repeatfix.v0.19.0Compare Source
With v0.19.0, I have fully reverted all the pre-commit changes done in the v0.18.0 line. I apologize for any drama this caused in your CI. I have learned my lesson and won't modify the pre-commit hook any further. Maybe something will change in the future if someone joins the team maintaining the hook (see https://redirect.github.com/google/yamlfmt/discussions/278) but I personally will not do it.
I have updated the pre-commit docs to include some configuration tricks for how to get around the problems this original form of the hook can cause. Hopefully this should be enough to resolve problems that some users originally experienced that inspired my attempt in the v0.18.0 series.
v0.18.1Compare Source
The previous fix for pre-commit was poorly done. The default experience for a pre-commit hook is to pass all the discovered filenames to the entry, and when yamlfmt receives references to exact files in its list of arguments, by design it will run them through the formatter without checking whether the config would want to run them. With the fix in v0.18.0, this would cause all files in a repo, including non-yaml ones, to run through the formatter unconditionally. I think I have finally settled on a proper implementation, which is explained in the docs.
On a related note, if you are knowledgeable about pre-commit and interested in the future of this project as a pre-commit hook, please take a look at my recent announcement: #278
v0.18.0Compare Source
The primary reason for this release is a change to the pre-commit hook that might be breaking to some users.
Features
pre-commit hook no longer specifies filetypes
The expectation for
yamlfmtis to be run in a working directory of many different filetypes, and to configure what you as a user want the tool to run on based on configuration (file extensions, doublestar patterns, etc). The hook no longer specifiestypes: [yaml]like it used to. You can restore this behaviour by overriding it in your pre-commit config like so:However, you will likely have a better experience by reconfiguring
yamlfmtto match the intended experience.Default usage message on misuse of command
If you use the command
yamlfmtwith no arguments, and no config is discovered, the tool will now output a default usage message to indicate to the user how to properly use the command.Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.