From f88fc8bff30a35649abe4b1946992fcb5538bdbb Mon Sep 17 00:00:00 2001 From: Abizer Lokhandwala Date: Tue, 5 May 2026 18:16:20 -0700 Subject: [PATCH] ci: fix brew style violations in generated cask MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .goreleaser.yaml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 57827d7..1c3a9ee 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -43,9 +43,14 @@ homebrew_casks: hooks: post: install: | - if OS.mac? - system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/nssh"] - end + system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/nssh"] if OS.mac? + # Populate the zap stanza so goreleaser's template doesn't emit a + # `# No zap stanza required` placeholder with a trailing blank line + # that trips Layout/EmptyLinesAroundBlockBody under `brew style`. + zap: + trash: + - "~/.local/state/nssh" + - "~/.config/nssh" release: github: