Skip to content

Commit 4bd4104

Browse files
abizerclaude
andauthored
ci: fix brew style violations in generated cask (#9)
## Summary \`brew test-bot\` is failing on \`abizer/homebrew-tap\` master ([run 25410956395](https://github.com/abizer/homebrew-tap/actions/runs/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](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!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. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit f88fc8b. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 08d386c commit 4bd4104

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

.goreleaser.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,14 @@ homebrew_casks:
4343
hooks:
4444
post:
4545
install: |
46-
if OS.mac?
47-
system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/nssh"]
48-
end
46+
system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/nssh"] if OS.mac?
47+
# Populate the zap stanza so goreleaser's template doesn't emit a
48+
# `# No zap stanza required` placeholder with a trailing blank line
49+
# that trips Layout/EmptyLinesAroundBlockBody under `brew style`.
50+
zap:
51+
trash:
52+
- "~/.local/state/nssh"
53+
- "~/.config/nssh"
4954

5055
release:
5156
github:

0 commit comments

Comments
 (0)