github TekWizely/pre-commit-golang v1.0.0-beta.3
Fix -repo hooks; Breaking changes to hook args; Alias/Name Usage - v1.0.0-beta.3

latest releases: v1.0.0-rc.1, v1.0.0-beta.5, v1.0.0-beta.4...
2 years ago

Release v1.0.0-beta.3

  • Fix -repo hooks
  • Breaking changes to hook args
  • Flesh out alias/name section in README

Fix -repo hooks

There was a bug in the newly introduced go-fmt based -repo hooks that broke the ability to add extra arguments to the hooks (via your pre-commit config args value)

A useful case for this might be setting the -w flag to allow fixing files in-place.

This release fixes the bug and can now support that use case for the various repo-level format hooks.

Breaking changes to hook args

Historically, the hooks accepted - as an alias for --, ie. stop processing flags and treat all further arguments as files.

using - as such an indicator is not really standard in any way, and I just had it as a convenience in case the user mistyped -- in their hook config.

As we approach a 1.0.0 release, I realize that this behavior could have a limiting factor on future tools, so I've decided to fix it now.

The hooks have special logic to auto-identify flags vs files and in most cases, the user doesn't even need to use --, so there's a good chance that this change hasn't affected any users.

Aliases / Names

I fleshed out a section in the docs that discusses some of the benefits of using aliases and names in your hook configurations. Namely:

  • Creating short names for long-named hooks for easier CLI usage
  • Having variations of a given hook with different configurations

You can read more about it in the README

Don't miss a new pre-commit-golang release

NewReleases is sending notifications on new releases.