Skip to content

Commit

Permalink
Fix FormulaAudit/{Checksum,Desc} problems in docs example code
Browse files Browse the repository at this point in the history
  • Loading branch information
issyl0 committed Jan 23, 2024
1 parent 6f4f19f commit c759444
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
3 changes: 3 additions & 0 deletions docs/Formula-Cookbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,7 @@ When parsing a download URL, Homebrew auto-detects the resource type it points t
```ruby
class Foo < Formula
homepage "https://github.com/some/package"
description "Some package"
url "https://github.com/some/package.git",
tag: "v1.6.2",
revision: "344cd2ee3463abab4c16ac0f9529a846314932a2"
Expand All @@ -697,6 +698,7 @@ If not inferable, specify which of Homebrew’s built-in download strategies to
```ruby
class Nginx < Formula
homepage "https://nginx.org/"
description "Some package"
url "https://nginx.org/download/nginx-1.23.2.tar.gz", using: :homebrew_curl
sha256 "a80cc272d3d72aaee70aa8b517b4862a635c0256790434dbfc4d618a999b0b46"
head "https://hg.nginx.org/nginx/", using: :hg
Expand Down Expand Up @@ -731,6 +733,7 @@ end
class Foo < Formula
url "something", using: MyDownloadStrategy
description "Some package"
end
```

Expand Down
2 changes: 1 addition & 1 deletion docs/Node-for-Formula-Authors.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class Foo < Formula
desc "Description"
homepage "..."
url "https://registry.npmjs.org/foo/-/foo-1.4.2.tgz"
sha256 "..."
sha256 "abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1"

depends_on "node"
# uncomment if there is a native addon inside the dependency tree
Expand Down
18 changes: 12 additions & 6 deletions docs/Python-for-Formula-Authors.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Foo < Formula
desc "Bar"
homepage "https://example.com"
url "..."
sha256 "abc123"
sha256 "abc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1"

def install
virtualenv_install_with_resources
Expand Down Expand Up @@ -122,12 +122,18 @@ end
You can also use the more verbose form and request that specific resources be installed:

```ruby
def install
venv = virtualenv_create(libexec)
%w[six parsedatetime].each do |r|
venv.pip_install resource(r)
class Foo < Formula
include Language::Python::Virtualenv

url "..."

def install
venv = virtualenv_create(libexec)
%w[six parsedatetime].each do |r|
venv.pip_install resource(r)
end
venv.pip_install_and_link buildpath
end
venv.pip_install_and_link buildpath
end
```

Expand Down

0 comments on commit c759444

Please sign in to comment.