Skip to content

Commit d3a6118

Browse files
authored
Merge pull request #20949 from Homebrew/style-formula-stubs
Use formula stubs for `shellcheck`, `shfmt`, and `actionlint` operations in `brew style`
2 parents fba80fe + a78ad99 commit d3a6118

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Library/Homebrew/style.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,18 +327,21 @@ def self.github_workflow_files
327327

328328
def self.shellcheck
329329
require "formula"
330-
Formula["shellcheck"].ensure_installed!(latest: true, reason: "shell style checks").opt_bin/"shellcheck"
330+
shellcheck_stub = Formulary.factory("shellcheck", prefer_stub: true)
331+
shellcheck_stub.ensure_installed!(latest: true, reason: "shell style checks").opt_bin/"shellcheck"
331332
end
332333

333334
def self.shfmt
334335
require "formula"
335-
Formula["shfmt"].ensure_installed!(latest: true, reason: "formatting shell scripts")
336+
shfmt_stub = Formulary.factory("shfmt", prefer_stub: true)
337+
shfmt_stub.ensure_installed!(latest: true, reason: "formatting shell scripts")
336338
HOMEBREW_LIBRARY/"Homebrew/utils/shfmt.sh"
337339
end
338340

339341
def self.actionlint
340342
require "formula"
341-
Formula["actionlint"].ensure_installed!(latest: true, reason: "GitHub Actions checks").opt_bin/"actionlint"
343+
actionlint_stub = Formulary.factory("actionlint", prefer_stub: true)
344+
actionlint_stub.ensure_installed!(latest: true, reason: "GitHub Actions checks").opt_bin/"actionlint"
342345
end
343346

344347
# Collection of style offenses.

0 commit comments

Comments
 (0)