Fix the lint problems in the generated Homebrew formula - #57
Conversation
Test results: removing the
|
| Input | Emitted |
|---|---|
version: v2026.8.0 |
version "2026.8.0" |
| omitted | (no version stanza) |
The generator's own docstring says as much — formula.py:50: "No version attribute if Homebrew can reliably infer the version from the tar URL (GitHub tag)".
Does Homebrew then infer the right version?
The workflow comment cites Justintime50/homebrew-releaser#39, where Homebrew detected 64 from the -amd64/-arm64 URLs. That issue is closed — the version input was its resolution.
Running Homebrew's own scanner against every URL this formula carries:
v2026.8.0.tar.gz -> 2026.8.0
localstack-cli-2026.8.0-darwin-amd64.tar.gz -> 2026.8.0
localstack-cli-2026.8.0-darwin-arm64.tar.gz -> 2026.8.0
localstack-cli-2026.8.0-linux-amd64.tar.gz -> 2026.8.0
localstack-cli-2026.8.0-linux-arm64.tar.gz -> 2026.8.0
And loading the stanza-less formula as a real tap:
inferred stable version: 2026.8.0
stable url: .../localstack-cli-2026.8.0-darwin-arm64.tar.gz
Note the resolved url is the -arm64 one — the exact shape #39 was about — and it still scans correctly. brew style, brew audit and brew audit --online all pass on that formula.
Why I still left it in
Detection depends on the shape of the version string. 2026.8.0 is unambiguous, so the scanner prefers it over the 64. A future version that reads more like an arch suffix could regress, and the failure lands on users rather than in CI, because nothing regenerates the formula until a release publishes.
So the trade is one style warning against a small chance of a broken formula. Removing the input is defensible now that the numbers above exist; keeping it costs one warning that the tap CI reports without blocking. Happy to push the removal if you want the clean sweep.
26793ee to
f3092a1
Compare
Co-Authored-By: Claude <noreply@anthropic.com>
f3092a1 to
a893d49
Compare
anisaoshafi
left a comment
There was a problem hiding this comment.
Thanks for fixing the issues reported in https://github.com/localstack/homebrew-tap/actions/runs/35750559123/job/106823254091 by the CI you added there 👏🏼
Motivation
Formula/localstack-cli.rbin localstack/homebrew-tap failsbrew stylewith 5 offences andbrew auditwith 7 problems. The formula is generated from this repo on every release, so it can only be fixed here.The tap now has CI that reports this (localstack/homebrew-tap#10), but it cannot block on the formula while the problems exist. This clears them, so that check can become mandatory.
Solution
Install block indentation (2 offences). The extra indentation was deliberate, and is no longer needed:
homebrew_releaser/formula.py:258indents every line by the template's 4 spaces and strips the indent from only the first, so the old workaround now causes what it once fixed.Test line (2 offences). An ambiguous regexp literal, and a redundant
0passed toshell_output:Licence (1 problem).
LICENSE.txtheld only the Apache-2.0 short notice, which GitHub's licensee cannot match, so the API reportedNOASSERTIONand the generator copied that into the formula. Replaced with the full Apache-2.0 text, copyright lines moved toNOTICEas Apache recommends. Not a change of licence — it formalises the one the file already declared.The
version:input (1 problem). Dropped, which lets Homebrew scan the version from the URL and removes theversion is redundantfinding.It was added for Justintime50/homebrew-releaser#39, where Homebrew read
64out of an…-darwin-arm64.tar.gzURL. That was a Homebrew bug, not a generator bug, and it is fixed — feeding Homebrew 7.0's scanner the exact URL from that issue now gives the right answer:The generated formula resolves
stable: 2026.8.0with noversionstanza.The last 2 problems came from the repository description, now
Deprecated LocalStack CLI packaged with PyInstaller, superseded by lstk.Validation
Ran
homebrew_releaser.formula.generate_formula_datawith these inputs and the live repository description, then linted the result — so this is what the next release generates:brew stylebrew auditbrew audit --onlineLicence detection, confirmed on this branch before merge:
The generated
descbecomesDeprecated localstack cli packaged with pyinstaller, superseded by lstk. The generator calls.capitalize(), so casing is lowered whatever the repo says; that is cosmetic and needs an upstream change.Follow-up
After this merges and a release publishes, the formula step in localstack/homebrew-tap#10 can drop its
continue-on-error: trueand become a hard gate.Review
Human review advised: it replaces
LICENSE.txtand changes the release path, which cannot be exercised without publishing a release.🤖 Generated with Claude Code