Skip to content

ci: fix brew style violations in generated cask#9

Merged
abizer merged 1 commit intomasterfrom
nssh-9
May 6, 2026
Merged

ci: fix brew style violations in generated cask#9
abizer merged 1 commit intomasterfrom
nssh-9

Conversation

@abizer
Copy link
Copy Markdown
Owner

@abizer abizer commented May 6, 2026

Summary

`brew test-bot` is failing on `abizer/homebrew-tap` master (run 25410956395) because the v2.4.1-generated `Casks/nssh.rb` has two RuboCop offenses:

  1. `Style/IfUnlessModifier` — multi-line `if OS.mac?` for a single statement. Rewritten as modifier-if.
  2. `Layout/EmptyLinesAroundBlockBody` — blank line before the cask's closing `end`, courtesy of goreleaser's `# No zap stanza required` placeholder. Replaced by a real `zap.trash` stanza listing the dirs nssh writes locally (`/.local/state/nssh`, `/.config/nssh`).

Test plan

  • Merge → cut a `patch` release (v2.4.2) → confirm goreleaser pushes a fresh `Casks/nssh.rb` to the tap
  • `brew test-bot` on the tap goes green
  • On macOS: `brew install --cask abizer/tap/nssh`; `nssh` launches without Gatekeeper alert; `brew uninstall --cask --zap nssh` cleans up local state

🤖 Generated with Claude Code


Note

Low Risk
Low risk: only adjusts GoReleaser Homebrew cask generation to satisfy brew style, without changing app runtime behavior beyond uninstall cleanup metadata.

Overview
Updates .goreleaser.yaml to change the generated Homebrew cask: the post-install quarantine removal hook is rewritten as a single-line modifier if OS.mac? to satisfy RuboCop.

Adds an explicit zap.trash section (listing ~/.local/state/nssh and ~/.config/nssh) to avoid GoReleaser emitting the # No zap stanza required placeholder that was causing brew style empty-line violations.

Reviewed by Cursor Bugbot for commit f88fc8b. Bugbot is set up for automated code reviews on this repo. Configure here.

The Casks/nssh.rb that goreleaser pushed for v2.4.1 fails `brew test-bot`
with two RuboCop offenses:

- Style/IfUnlessModifier on the `if OS.mac?` postflight block — fixed
  by rewriting it as a modifier-if. The guard is still needed because
  the cask has on_linux URL stanzas, so postflight can theoretically
  run on linuxbrew where /usr/bin/xattr doesn't exist.
- Layout/EmptyLinesAroundBlockBody on the trailing blank before the
  cask's closing `end`. That blank is from goreleaser's template
  emitting `# No zap stanza required\n\n` when no zap is configured.
  Adding a real zap stanza replaces the placeholder. The paths chosen
  (~/.local/state/nssh, ~/.config/nssh) match what nssh actually writes
  on the local Mac (logs, session state, optional config.toml).

Cut a v2.4.2 release after this merges to regenerate Casks/nssh.rb
and clear the red status on abizer/homebrew-tap master.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@abizer abizer merged commit 4bd4104 into master May 6, 2026
2 checks passed
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Zap stanza missing ~/.cache/nssh cleanup path
    • Added ~/.cache/nssh to the cask zap.trash list so brew uninstall --zap cleans up the local release tarball cache.

Create PR

Or push these changes by commenting:

@cursor push 99ae82d1b4
Preview (99ae82d1b4)
diff --git a/.goreleaser.yaml b/.goreleaser.yaml
--- a/.goreleaser.yaml
+++ b/.goreleaser.yaml
@@ -51,6 +51,7 @@
       trash:
         - "~/.local/state/nssh"
         - "~/.config/nssh"
+        - "~/.cache/nssh"
 
 release:
   github:

You can send follow-ups to the cloud agent here.

Reviewed by Cursor Bugbot for commit f88fc8b. Configure here.

Comment thread .goreleaser.yaml
zap:
trash:
- "~/.local/state/nssh"
- "~/.config/nssh"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zap stanza missing ~/.cache/nssh cleanup path

Low Severity

The zap.trash stanza in the Homebrew formula is missing ~/.cache/nssh. This directory, created by downloadBinary in infect.go for caching release tarballs (e.g., ~/.cache/nssh/releases/), remains after brew uninstall --zap, allowing cached files to accumulate.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f88fc8b. Configure here.

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