diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 889c5dc..3aa2f76 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -64,7 +64,7 @@ checksum: snapshot: version_template: "{{ .Tag }}-dev" -brews: +homebrew_casks: - name: goctx repository: owner: preminger @@ -77,25 +77,25 @@ brews: description: "Command-line Go utility that automatically adds missing 'plumbing' for `context.Context` parameters along the call-graph leading to a given function." license: "Apache-2.0" - # Installation logic for the binary and completions - # We point to the 'completions' folder created in the archive step above - install: | - bin.install "goctx" - bash_completion.install "completions/goctx.bash" => "goctx" - zsh_completion.install "completions/goctx.zsh" => "_goctx" - fish_completion.install "completions/goctx.fish" + binaries: + - goctx + + # Instructs Homebrew to execute the binary to fetch shell completions natively + generate_completions_from_executable: + executable: "goctx" + args: ["completion"] # Adjust if your subcommand is named differently + shell_parameter_format: cobra # Options: cobra, clap, click, flag, none, typer - # Useful information displayed after 'brew install' caveats: | + If you previously installed goctx via homebrew formulas, please run: + brew uninstall preminger/tap/goctx + To enable completions, you may need to add the following to your shell profile, and then open a new shell: zsh: autoload -U compinit && compinit bash: [[ -r "$(brew --prefix)/etc/profile.d/bash_completion.sh" ]] && . "$(brew --prefix)/etc/profile.d/bash_completion.sh" - test: | - system "#{bin}/goctx --version" - release: draft: false github: diff --git a/CHANGELOG.md b/CHANGELOG.md index 6940eb9..3687b6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.17.34] - 2026-05-24 + +### Changed + +- Transition to new Goreleaser `homebrew_casks:` apparatus (after deprecation of `brews:`). This means that `stave` will now be released to Homebrew as a cask rather than a formula, and the new cask is intentionally configured to _conflict_ with the old formula. +- Bump all updatable Go dependencies to their latest versions as of this date. +- Bump `stave` to `v0.14.9`. + ## [0.17.33] - 2026-05-19 ### Changed @@ -96,7 +104,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Change pre-push [trufflehog](https://github.com/trufflesecurity/trufflehog) hook to only scan *changes*, rather than entire repo. +- Change pre-push [trufflehog](https://github.com/trufflesecurity/trufflehog) hook to only scan _changes_, rather than entire repo. - Bump `stave` to `v0.10.10`. ## [0.17.18] - 2026-02-19 @@ -219,7 +227,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Use `stave` version `0.6.x`'s [*Keep a Changelog*](https://keepachangelog.com/en/1.1.0/)-based release notes functionality. +- Use `stave` version `0.6.x`'s [_Keep a Changelog_](https://keepachangelog.com/en/1.1.0/)-based release notes functionality. - Ship to Homebrew as a formula rather than a cask, and ship with completions support. ## [0.16.4] - 2025-12-22 @@ -337,7 +345,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- When you are in a subdir *below* where the `go.mod` is, and you run `goctx` with a TARGET argument that specifies a function in a source file in the current dir - but that function is called elsewhere in the module *outside* of this subdir - the app now adjusts all the relevant call sites within the module, not just the ones in the current subdir. +- When you are in a subdir _below_ where the `go.mod` is, and you run `goctx` with a TARGET argument that specifies a function in a source file in the current dir - but that function is called elsewhere in the module _outside_ of this subdir - the app now adjusts all the relevant call sites within the module, not just the ones in the current subdir. - Both functions defined in `*_test.go` files, and callsites contained in `*_test.go` files (even in cases where no signatures of functions defined in `*_test.go` were changed), are now correctly handled. - App now correctly distinguishes between `MyFunc()`, `xyz.MyFunc()` (where `xyz` is a package name), `a.MyFunc()` (where `a` is an object of type `TypeA`), and `b.MyFunc()` (where `b` is an object of type `TypeB`). Changes to the function signature of one of these will not affect call sites where the others are called. - When a function `MyFunc` contains calls to two functions `MyOtherFunc1` and `MyOtherFunc2`, and a context argument has been added to both `MyOtherFunc1` and `MyOtherFunc2`, only one context argument will be added to `MyFunc`'s signature (and that single argument will be used in the calls to both `MyOtherFunc1` and `MyOtherFunc2`). @@ -549,7 +557,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Removed -- Printing of what next git tag *would* be in Makefile `test` target, and associated flags in `actions/checkout@v4` step in `checks` workflow. +- Printing of what next git tag _would_ be in Makefile `test` target, and associated flags in `actions/checkout@v4` step in `checks` workflow. ## [0.5.2] - 2025-11-02 @@ -567,7 +575,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- Print message about what next git tag *would* be in Makefile `test` target. +- Print message about what next git tag _would_ be in Makefile `test` target. ### Fixed @@ -611,7 +619,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [0.4.0] - 2025-10-30 -[unreleased]: https://github.com/preminger/goctx/compare/v0.17.33...HEAD +[unreleased]: https://github.com/preminger/goctx/compare/v0.17.34...HEAD +[0.17.34]: https://github.com/preminger/goctx/compare/v0.17.33...v0.17.34 [0.17.33]: https://github.com/preminger/goctx/compare/v0.17.32...v0.17.33 [0.17.32]: https://github.com/preminger/goctx/compare/v0.17.31...v0.17.32 [0.17.31]: https://github.com/preminger/goctx/compare/v0.17.30...v0.17.31 diff --git a/go.mod b/go.mod index 879bbbf..95f2b83 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/sebdah/goldie/v2 v2.8.0 github.com/spf13/cobra v1.10.2 github.com/stretchr/testify v1.11.1 - github.com/yaklabco/stave v0.14.8 + github.com/yaklabco/stave v0.14.9 golang.org/x/tools v0.45.0 ) @@ -25,7 +25,7 @@ require ( github.com/charmbracelet/ultraviolet v0.0.0-20260511121909-c840852527f3 // indirect github.com/charmbracelet/x/ansi v0.11.7 // indirect github.com/charmbracelet/x/cellbuf v0.0.15 // indirect - github.com/charmbracelet/x/exp/charmtone v0.0.0-20260519012233-798e623c8447 // indirect + github.com/charmbracelet/x/exp/charmtone v0.0.0-20260524005558-961435f30453 // indirect github.com/charmbracelet/x/term v0.2.2 // indirect github.com/charmbracelet/x/termios v0.1.1 // indirect github.com/charmbracelet/x/windows v0.2.2 // indirect @@ -62,12 +62,12 @@ require ( github.com/spf13/viper v1.21.0 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect - github.com/yaklabco/direnv/v2 v2.37.2-0.20260408140756-a0bfab26dddf // indirect + github.com/yaklabco/direnv/v2 v2.37.2-0.20260524202835-d4a632bddfe5 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/exp v0.0.0-20260508232706-74f9aab9d74a // indirect golang.org/x/mod v0.36.0 // indirect golang.org/x/sync v0.20.0 // indirect - golang.org/x/sys v0.44.0 // indirect + golang.org/x/sys v0.45.0 // indirect golang.org/x/term v0.43.0 // indirect golang.org/x/text v0.37.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index bf59458..626683f 100644 --- a/go.sum +++ b/go.sum @@ -26,8 +26,8 @@ github.com/charmbracelet/x/ansi v0.11.7 h1:kzv1kJvjg2S3r9KHo8hDdHFQLEqn4RBCb39dA github.com/charmbracelet/x/ansi v0.11.7/go.mod h1:9qGpnAVYz+8ACONkZBUWPtL7lulP9No6p1epAihUZwQ= github.com/charmbracelet/x/cellbuf v0.0.15 h1:ur3pZy0o6z/R7EylET877CBxaiE1Sp1GMxoFPAIztPI= github.com/charmbracelet/x/cellbuf v0.0.15/go.mod h1:J1YVbR7MUuEGIFPCaaZ96KDl5NoS0DAWkskup+mOY+Q= -github.com/charmbracelet/x/exp/charmtone v0.0.0-20260519012233-798e623c8447 h1:ZJxL6oPAQXzr21550ad/ZNkHKC3Ita70bl4xVZUPqqE= -github.com/charmbracelet/x/exp/charmtone v0.0.0-20260519012233-798e623c8447/go.mod h1:nsExn0DGyX0lh9LwLHTn2Gg+hafdzfSXnC+QmEJTZFY= +github.com/charmbracelet/x/exp/charmtone v0.0.0-20260524005558-961435f30453 h1:WC+pgy4wN563yShDytCj7lp6FpG19V+wPeXhpCRbHkY= +github.com/charmbracelet/x/exp/charmtone v0.0.0-20260524005558-961435f30453/go.mod h1:nsExn0DGyX0lh9LwLHTn2Gg+hafdzfSXnC+QmEJTZFY= github.com/charmbracelet/x/exp/golden v0.0.0-20250806222409-83e3a29d542f h1:pk6gmGpCE7F3FcjaOEKYriCvpmIN4+6OS/RD0vm4uIA= github.com/charmbracelet/x/exp/golden v0.0.0-20250806222409-83e3a29d542f/go.mod h1:IfZAMTHB6XkZSeXUqriemErjAWCCzT0LwjKFYCZyw0I= github.com/charmbracelet/x/term v0.2.2 h1:xVRT/S2ZcKdhhOuSP4t5cLi5o+JxklsoEObBSgfgZRk= @@ -139,10 +139,10 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8 github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= -github.com/yaklabco/direnv/v2 v2.37.2-0.20260408140756-a0bfab26dddf h1:vBvd306Igh58n1yP/+g3RPGYJ0voPliGwRWhTccMXzM= -github.com/yaklabco/direnv/v2 v2.37.2-0.20260408140756-a0bfab26dddf/go.mod h1:Q6SgBrVaKeL+JevNgbtZ9MnqqnV5YFCRf61RkxDLfU4= -github.com/yaklabco/stave v0.14.8 h1:hWFd8sNmcyHWyhwMF135SabZOWEutoRooUnTUxsf76M= -github.com/yaklabco/stave v0.14.8/go.mod h1:UhuMWKfaJuhK9JAf4K0oX2EaeuSpxKDHjWA2hsy2t4A= +github.com/yaklabco/direnv/v2 v2.37.2-0.20260524202835-d4a632bddfe5 h1:mTM6am4L9HntIAHA0SRfX5RHAU/s7wbjRKGocvo4XnY= +github.com/yaklabco/direnv/v2 v2.37.2-0.20260524202835-d4a632bddfe5/go.mod h1:fc8HRAhQPQdPWpFjKxZ5NGgA3Dn4I71VGtIJVPZS5LM= +github.com/yaklabco/stave v0.14.9 h1:Ma2dEEfXEKAPnWkFcKJXNQtby9kKcGwBSFbcy2HqvoM= +github.com/yaklabco/stave v0.14.9/go.mod h1:GeL1WJ/aUEU4w4hsVw//YaddUyZS+A/4mA+bzN3Hmgo= go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= golang.org/x/exp v0.0.0-20260508232706-74f9aab9d74a h1:+3jdDGGB8NGb1Zktc737jlt3/A5f6UlwSzmvqUuufxw= @@ -151,8 +151,8 @@ golang.org/x/mod v0.36.0 h1:JJjpVx6myfUsUdAzZuOSTTmRE0PfZeNWzzvKrP7amb4= golang.org/x/mod v0.36.0/go.mod h1:moc6ELqsWcOw5Ef3xVprK5ul/MvtVvkIXLziUOICjUQ= golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= -golang.org/x/sys v0.44.0 h1:ildZl3J4uzeKP07r2F++Op7E9B29JRUy+a27EibtBTQ= -golang.org/x/sys v0.44.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY= +golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/term v0.43.0 h1:S4RLU2sB31O/NCl+zFN9Aru9A/Cq2aqKpTZJ6B+DwT4= golang.org/x/term v0.43.0/go.mod h1:lrhlHNdQJHO+1qVYiHfFKVuVioJIheAc3fBSMFYEIsk= golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc= diff --git a/stavefile.go b/stavefile.go index c0352d9..9966406 100644 --- a/stavefile.go +++ b/stavefile.go @@ -98,7 +98,7 @@ func Init() { // Build builds artifacts via goreleaser snapshot build func Build() error { - st.Deps(Init) + st.Deps(Init, Clean) if err := sh.RunV("goreleaser", "check"); err != nil { return err @@ -109,6 +109,8 @@ func Build() error { // Release tags the next version and runs goreleaser release func Release() error { + st.Deps(Clean) + if err := releasePrepper(tagAndPush); err != nil { return err } @@ -119,6 +121,8 @@ func Release() error { // Snapshot is like Release except it runs locally and does not push a new tag; // useful for debugging the release process. func Snapshot() error { + st.Deps(Clean) + noopTaggingFunc := func(string) error { return nil } if err := releasePrepper(noopTaggingFunc); err != nil { return err