This document contains information for developers working on formulas in this tap.
homebrew-tap/
├── Formula/ # Homebrew formula files
│ └── submarine.rb
├── Justfile # Task runner commands
├── README.md # User documentation
└── DEV.md # This file
-
Create a new formula file in
Formula/directory:brew create https://github.com/user/project/releases/download/VERSION/file.zip \ --tap lebe-dev/tap \ --set-name project-name
-
Edit the generated formula file in
Formula/ -
Audit the formula:
just audit # or HOMEBREW_NO_INSTALL_FROM_API=1 brew audit --new lebe-dev/tap/formula-name -
Test installation:
just install # or HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source --verbose lebe-dev/tap/formula-name -
Run formula tests:
just test # or HOMEBREW_NO_INSTALL_FROM_API=1 brew test lebe-dev/tap/formula-name
The Justfile provides convenient commands for development:
just audit- Audit the submarine formulajust install- Install submarine formula locally for testingjust test- Run formula testsjust uninstall- Uninstall submarine formulajust test-all- Full test cycle: audit, install, testjust reinstall- Clean uninstall and reinstall
Always test your formulas before committing:
-
Syntax validation:
HOMEBREW_NO_INSTALL_FROM_API=1 brew audit --new lebe-dev/tap/formula-name
-
Installation test:
HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source --verbose lebe-dev/tap/formula-name
-
Formula test:
HOMEBREW_NO_INSTALL_FROM_API=1 brew test lebe-dev/tap/formula-name -
Manual functionality test: Test the actual binary/application functionality
-
Uninstall test:
brew uninstall formula-name
class FormulaName < Formula
desc "Short description of the software"
homepage "https://project-homepage.com"
url "https://github.com/user/project/releases/download/VERSION/archive.zip"
version "X.Y.Z"
sha256 "checksum-here"
license "MIT"
def install
bin.install "binary-name"
end
test do
assert_match "version X.Y.Z", shell_output("#{bin}/binary-name --version")
end
end- Naming: Use simple names without tap prefix (e.g.,
submarine.rb, notlebe-dev-submarine.rb) - Class Name: Match filename in CamelCase (e.g.,
Submarineforsubmarine.rb) - Description: Keep it concise and clear
- Tests: Always include a test block that verifies the installation
- Checksums: Use SHA256 checksums for all downloads
For ARM64-only binaries on macOS:
- Use a single
urlandsha256declaration - Intel Macs will automatically use Rosetta 2
- No need for
on_armoron_intelblocks for URL/SHA256
The repository includes GitHub Actions workflows:
- tests.yml - Runs on every push and PR, tests across multiple platforms
- publish.yml - Handles bottle publishing for merged PRs