
- The autocorrections here before were leading to changes like: ``` ➜ brew style --fix brewsci/science/beetl Formula/beetl.rb:15:11: C: [Corrected] GitHub patches should use the full_index parameter: https://github.com/BEETL/BEETL/commit/ba47b6f9.patch?full_index=1 url "https://github.com/BEETL/BEETL/commit/ba47b6f9.patch" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ➜ git diff diff --git a/Formula/beetl.rb b/Formula/beetl.rb index bbd049aa..7ec6d7bc 100644 --- a/Formula/beetl.rb +++ b/Formula/beetl.rb @@ -12,7 +12,7 @@ class Beetl < Formula # Fixes "error: 'accumulate' is not a member of 'std'" # Upstream commit "Little fix for compilation on mac" patch do - url "https://github.com/BEETL/BEETL/commit/ba47b6f9.patch" + url https://github.com/BEETL/BEETL/commit/ba47b6f9.patch?full_index=1 sha256 "63b67f3282893d1f74c66aa98f3bf2684aaba2fa9ce77858427b519f1f02807d" end end ``` - This fixes the URLs generated to have quotes: ``` ➜ git diff diff --git a/Formula/beetl.rb b/Formula/beetl.rb index bbd049aa..7ec6d7bc 100644 --- a/Formula/beetl.rb +++ b/Formula/beetl.rb @@ -12,7 +12,7 @@ class Beetl < Formula # Fixes "error: 'accumulate' is not a member of 'std'" # Upstream commit "Little fix for compilation on mac" patch do - url "https://github.com/BEETL/BEETL/commit/ba47b6f9.patch" + url "https://github.com/BEETL/BEETL/commit/ba47b6f9.patch?full_index=1" sha256 "63b67f3282893d1f74c66aa98f3bf2684aaba2fa9ce77858427b519f1f02807d" end end ```
Homebrew Ruby API
This is the API for Homebrew.
The main class you should look at is the {Formula} class (and classes linked from there). That's the class that's used to create Homebrew formulae (i.e. package descriptions). Assume anything else you stumble upon is private.
You may also find the Formula Cookbook and Ruby Style Guide helpful in creating formulae.
Good luck!