Skip to content

Commit f88fc8b

Browse files
abizerclaude
andcommitted
ci: fix brew style violations in generated cask
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>
1 parent 08d386c commit f88fc8b

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)