Skip to content
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

Update pre-commit hook google/yamlfmt to v0.16.0 #69

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jan 5, 2025

This PR contains the following updates:

Package Type Update Change
google/yamlfmt repository minor v0.13.0 -> v0.16.0

Note: The pre-commit manager in Renovate is not supported by the pre-commit maintainers 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.16.0

Compare Source

Fixing yaml library stuff

This release features fixes for a couple problems in the yaml library, and one new feature.

Features

Alternate Array Indentation

There is now support for array_indent, indenting arrays at a different level than anything else, and indent_root_array, an option to indent an array that is at the root of the document.
To tell you the truth, I couldn't have possibly imagined anyone wanting this. It's quite outlandish to me. I decided to implement it because the request was well specified (#​237), it was very simple to implement, and it could be implemented in a completely unintrusive and opt-in way, without me needing to worry whether other parsing might break as a result. Given that, I figured adding new options couldn't hurt!

Bug Fixes

Nested Indentless Arrays

There was an edge case where nested arrays would get collapsed when doing indentless arrays. This has been fixed now and should function as expected.

Comment Rendering Above Document Start

Comments above a document start used to end up rendered below the document start token with an extra newline. After digging into it I found out that this was a deliberate choice made by the upstream library (i.e. it was not in libyaml which that library was ported from) and I consider it an odd choice. I've changed it to work how one would expect, with comments above document start being rendered above the --- token.
I decided to make the change directly without guarding it with an option, since I thought the default behaviour was so odd and I can't imagine a world where someone wants it that way. But yaml is stupid, you never know if there's a random edge case I couldn't fathom that was broken by this. Hoping it will be okay, but might need a patch release if there's something I missed.

Contributors

  • Thanks @​abicky for fixing the nested indentless array bug
  • Thanks @​ELLIOTTCABLE for the original feature request for array indentation and contributing to the development of it

v0.15.0

Compare Source

Happy 2025!

New year new yamlfmt release! This one once again only features things contributed by the community. I am working on a major feature that I was hoping to finish before pushing this release out, but I ran into a snag and I didn't want to delay these things getting released.

Breaking Changes

New Minimum Go Version is 1.21

Originally I was keeping this library compatible with Go 1.18, which was the latest at the time. There was a time when I tried to update the minimum version to Go 1.20 when it was released, and I ended up getting complaints so I kept it where it was. Go 1.18 is long EOL, and it makes more sense as an application to stay up to date to in-support releases. So the new rule of thumb will be to maintain compatibility with the oldest non-EOL version of Go going forward.

Features

gitlab output format

Generate yamlfmt results in GitLab Code Quality report format. See more info here.

gitignore match type

We had support already for gitignore_excludes, i.e. using a gitignore file to match which files to exclude, similar to how it works with Git. However, it can be useful for positive matches, i.e. what files to actually include, since the gitignore patterns can also be negated meaning that all includes and excludes can be managed by a single gitignore-style file. See more info here.

yamlfmt Docker image

yamlfmt is now available as a Docker image! This was originally done for the purpose of using yamlfmt in CI, but could be useful in other scenarios too. See download and usage instructions in the README.

Contributors

  • Thanks @​octo for contributing the gitlab output format and gitignore match type, as well as improvements to the integration test workflow
  • Thanks @​mrueg for updating the build and test flows from Go 1.18 to Go 1.21 and removing EOL versions
  • Thanks @​fsrv-xyz for the Docker image work
  • Thanks @​alexandear for doc fixes and test name typo fixes
  • Thanks @​wusatosi for the pre-commit doc update

I'm hoping my big new feature will be ready for the next update. Thanks for using yamlfmt, and thanks to all the contributors!

v0.14.0

Compare Source

Shoutouts To The Community Release

I have been in not the best health the last while, which is why this release took so long to cut. On the bright side, this release features more contributions from the community than from myself. Thank you to everyone who contributed!

Features

strip_directives

yaml.v3 does not support directives. The best thing to do would be to add some amount of support for directives, which I will do in the future just taking it as far as the parser not failing upon finding a directive. In the short term, I added a hotfix style feature that will strip the directives before formatting and put them back in. The feature is fraught with edge cases and only works reliably with directives at the top of the file. See the explanations I added in the docs.

gitignore_excludes searches up the directory structure for the nearest .gitignore

Arguably a fix, the gitignore_excludes feature will now look up the directory structure for the nearest .gitignore which unlocks monorepo usage patterns for yamlfmt.

JSON schema

The community has added a JSON Schema! I'm calling it out in release notes, but this is not tied to yamlfmt releases in any way. If you have any fixes or improvements to make, they will not need to be tied to git tags being cut.

I am not super familiar with JSON Schema; I will try my best not to break it and keep it up to date but I'm not gonna be great at addressing potential deeper issues with it.

Validating releases with cosign

The release artifacts now generate other artifacts that allow you to verify releases using the cosign tool.

Fixes

The line_ending setting in the formatter config is respected again

This was a regression in v0.13.0 where I did some refactors to config discovery. I uncovered an edge case in my original code to handle the line_ending setting in the formatter block (vs the global version). This has been fixed in this release.

eof_newline no longer panics on an empty file

If the file was empty, the eof_newline feature would panic. Never thought of that! This has been fixed.

Contributors

@​thiagowfx added the JSON Schema
@​Shion1305 fixed the eof_newline panic
@​dhth added cosign support to releases
@​nikaro added .gitignore discovery

I think this is the most contributors I've had in a release! Thank you everyone!

Changelog (generated)

Full Changelog: google/yamlfmt@v0.13.0...v0.14.0


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot changed the title Update pre-commit hook google/yamlfmt to v0.14.0 Update pre-commit hook google/yamlfmt to v0.15.0 Jan 10, 2025
@renovate renovate bot force-pushed the renovate/google-yamlfmt-0.x branch 2 times, most recently from eaa5467 to 1372863 Compare January 12, 2025 18:04
@renovate renovate bot changed the title Update pre-commit hook google/yamlfmt to v0.15.0 Update pre-commit hook google/yamlfmt to v0.16.0 Feb 10, 2025
@renovate renovate bot force-pushed the renovate/google-yamlfmt-0.x branch from 1372863 to d9610df Compare February 10, 2025 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant