851 Commits

Author SHA1 Message Date
Bevan Kay
2b151d30e7
rubocop: replace :unsigned automatically 2025-08-23 13:13:48 +10:00
copilot-swe-agent[bot]
7f6b4bee93
Implement SHA256 architecture audit as RuboCop rule
Co-authored-by: p-linnane <105994585+p-linnane@users.noreply.github.com>
Co-authored-by: MikeMcQuaid <125011+MikeMcQuaid@users.noreply.github.com>
2025-08-19 14:45:01 +01:00
Ruoyu Zhong
3f4d19e87b
Re-enable GNU mirror audit
Follow-up to Homebrew/brew#20461 and #233493.
2025-08-14 23:50:53 +08:00
Ruoyu Zhong
049e8cc61c
Update and temporarily disable GNU mirror audit
Update the audit to prefer ftpmirror.gnu.org over ftp.gnu.org as
suggested by GNU [1]:

> We recommend using this generic ftpmirror.gnu.org address wherever
> possible in links, documentation, etc., to reduce load on the main GNU
> server.

The audit is temporarily disabled to allow migrating all homebrew/core
formulae first.

Should help to address #20456.

[1]: https://www.gnu.org/server/mirror.en.html
2025-08-14 22:03:13 +08:00
Mike McQuaid
5602f0e11e
Merge pull request #20451 from Homebrew/dependabot/all-dbdec0a9b9
Bump the "all" group with 2 updates across multiple ecosystems
2025-08-14 09:10:26 +00:00
Mike McQuaid
7dd47ca89a
Merge pull request #20421 from Homebrew/cask-rename-stanza
cask/dsl/rename: add new `rename` dsl
2025-08-14 08:51:45 +00:00
Patrick Linnane
2605529a90
brew style --fix 2025-08-13 12:23:12 -07:00
Issy Long
d7b59fdfe8
Merge pull request #20402 from Homebrew/head-url-must-always-specify-branch
Ensure that `head` Git URLs always specify a branch name
2025-08-13 07:47:21 +00:00
Bevan Kay
9cb2b65319
cask/dsl/rename: add new rename dsl 2025-08-12 23:24:20 +10:00
Issy Long
05b27aa847
Disallow head do blocks with only url and branch
- Since `head` must now specify a url and branch, the `head do` block
  with only these stanzas can be condensed to the single-line
  `head "url", branch: "branch"` format.
2025-08-10 20:52:58 +01:00
Thierry Moisan
9de0395c3b
patches audit: add tests for patches corrector 2025-08-10 15:33:35 -04:00
Eric Knibbe
626b6aca2d
RubyDoc output fixes 2025-08-05 17:13:42 -04:00
Eric Knibbe
6255263b51
output: express environment variables consistently 2025-08-04 09:50:06 -04:00
Patrick Linnane
4513a43d53
Fix RuboCop failures.
Co-authored-by: Patrick Linnane <patrick@linnane.io>
Co-authored-by: Carlo Cabrera <github@carlo.cab>
Co-authored-by: Thierry Moisan <thierry.moisan@gmail.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2025-07-14 19:12:38 +01:00
Issy Long
7f333ab6ec
Merge pull request #20235 from Homebrew/slash-not-plus-in-paths
rubocops/text: Prefer `lib/"string"` over `lib+"string"`
2025-07-11 12:56:54 +00:00
Issy Long
d4d1b4a22a
rubocops/text: Prefer lib/"string" over lib+"string"
- I found a few occurrences of this pattern from
  https://github.com/orgs/Homebrew/projects/5?pane=issue&itemId=97021840,
  that is an automated style request for:
  `core: use / instead of + operator in e.g. (lib+"lv").install "lv.hlp"`.
- Upon adding tests I realised that there's also the `prefix + "bin"`
  case that's already handled differently, so let's combine the handling
  given it's the same `+` that's wrong.
2025-07-11 13:41:58 +01:00
Mike McQuaid
71bab462e1
Add ZeroZeroZeroZero cop
Add a new RuboCop to detect the use of 0.0.0.0 in formulae which
indicates binding to all network interfaces, internally or externally,
so is a bad default and potentially a security risk.

Co-authored-by: Issy Long <me@issylong.com>
2025-07-11 08:24:19 +01:00
Mike McQuaid
d661cffc1f
Switch to using main as the default branch
Homebrew/brew has moved to a `main` default branch so we can more move
references from `master` to `main`.
2025-06-24 11:14:57 +01:00
Mike McQuaid
afa5d50b36
rubocops/caveats: only apply dynamic logic check to core.
This doesn't really matter for non-API taps.
2025-06-23 08:58:34 +01:00
Mike McQuaid
f77c9861de
rubocops/caveats: check for dynamic caveats.
This will avoid issues with the JSON API.
2025-06-19 10:13:32 +01:00
botantony
aecdcd4840
rubocops: add no_autobump! rubocop
Signed-off-by: botantony <antonsm21@gmail.com>
2025-06-18 16:16:12 +02:00
Eric Knibbe
ea8152757e
rubocops/cask/no_overrides: avoid nested depends_on macos: 2025-06-10 14:31:58 -04:00
Eric Knibbe
c75122c694
rubocops/cask/url: put keyword parameters on a new line 2025-06-05 10:53:34 -04:00
Eric Knibbe
cd6777fc73
audits: quote and reword problem description text 2025-05-30 23:49:26 -04:00
Colin Dean
d5b3ae095c
Prohibit non-ASCII characters in URLs, nudge toward punycode
Inspired by curl's blog post, [Detecting malicious Unicode][1], this likely captures most if not all cases and nudges the user toward supplying IDNs with punycode.

A possible improvement would be telling the user exactly what punycode domain to use instead, but that may require another library as I can't quickly find something built into the Ruby stdlib that handles punycode encoding.

[1]: https://daniel.haxx.se/blog/2025/05/16/detecting-malicious-unicode/

Co-authored-by: Štefan Baebler <319826+stefanb@users.noreply.github.com>
2025-05-21 12:42:07 +01:00
Sean Molenaar
107120e4d8
Merge pull request #19880 from Moisan/audit_bitbucket_patch
patches audit: bitbucket patches should use api
2025-05-15 12:45:30 +00:00
Eric Knibbe
0838ceda90
cask: document shell completion stanzas
Also, allow them to be given a `target:` parameter.
2025-05-09 14:47:26 -04:00
Thierry Moisan
84704c5587
patches audit: bitbucket patches should use api 2025-05-01 22:53:42 -04:00
Mike McQuaid
c9a7b62b1d
Homebrew 4.5 deprecations/disables/removals
The usual cycle of deprecating, disabling, and removing things in
Homebrew major/minor releases.
2025-04-22 17:15:23 +01:00
Carlo Cabrera
ab59e2d5dc
Merge branch 'master' into arm64-linux-bottle-blocks 2025-03-18 17:25:00 +08:00
Carlo Cabrera
11827656a9
Fix bottle block generation and audit for arm64 Linux
Before this change, `brew bottle` would add the `:arm64_linux` bottle
lines last. This would make `brew style` complain because it wants the
`arm64_*` bottles listed first.

Let's fix this by retaining the existing style as closely as possible:
- macOS bottles are listed first
- for each OS, arm64 bottles are listed first (just as we do on macOS)

In particular, `brew bottle` will now insert `:arm64_linux` bottle lines
just above the `:x86_64_linux` bottle lines (but still below the macOS
bottle lines).

x86_64 may continue to be a more popular platform on Linux for quite
some time. However, users looking for those bottles can continue to look
in the same place as before this change (i.e., the last line of the
bottle block). Taking this together with the consistency on macOS
mentioned above, I think this is the right way forward here.

For concreteness, here are some examples of bottle blocks before and after
this change.

Before this change, immediately after `brew bottle`:

    bottle do
      sha256 arm64_sequoia: "1a57e04052f4bae4172d546a7927c645fc29d2ef5fafbec19d08ee1dddc542fb"
      sha256 arm64_sonoma:  "a58cf9af5d04d3d5709b5337f3793586087a79e178da51d1f3978c0c13b8cf34"
      sha256 ventura:       "6d8b90b2cbb31dcb78394c6540f5454cd57232fc309921173814f880e63718f0"
      sha256 x86_64_linux:  "cd5faac2834ba79e39429b9aac99e4f69d6e6023cbb1cbcd0b62e94cfc69bb2a"
      sha256 arm64_linux:   "457d3e9bd0c287483e27f29a488a18c90e1f55be076fc49b07942ef396c419be"
    end

Before this change, after doing `brew style --fix`:

    bottle do
      sha256 arm64_sequoia: "1a57e04052f4bae4172d546a7927c645fc29d2ef5fafbec19d08ee1dddc542fb"
      sha256 arm64_sonoma:  "a58cf9af5d04d3d5709b5337f3793586087a79e178da51d1f3978c0c13b8cf34"
      sha256 arm64_linux:   "457d3e9bd0c287483e27f29a488a18c90e1f55be076fc49b07942ef396c419be"
      sha256 ventura:       "6d8b90b2cbb31dcb78394c6540f5454cd57232fc309921173814f880e63718f0"
      sha256 x86_64_linux:  "cd5faac2834ba79e39429b9aac99e4f69d6e6023cbb1cbcd0b62e94cfc69bb2a"
    end

After this change:

    bottle do
      sha256 arm64_sequoia: "1a57e04052f4bae4172d546a7927c645fc29d2ef5fafbec19d08ee1dddc542fb"
      sha256 arm64_sonoma:  "a58cf9af5d04d3d5709b5337f3793586087a79e178da51d1f3978c0c13b8cf34"
      sha256 ventura:       "6d8b90b2cbb31dcb78394c6540f5454cd57232fc309921173814f880e63718f0"
      sha256 arm64_linux:   "457d3e9bd0c287483e27f29a488a18c90e1f55be076fc49b07942ef396c419be"
      sha256 x86_64_linux:  "cd5faac2834ba79e39429b9aac99e4f69d6e6023cbb1cbcd0b62e94cfc69bb2a"
    end
2025-03-18 16:10:43 +08:00
Issy Long
089680c76f
rubocops/cask/stanza_order: Ensure arch and os are adjacent
- Because Patrick wanted this to be codified.
2025-03-16 21:36:07 +00:00
Heath Stewart
42caf20fa4
Add PowerShell (pwsh) completion support
Resolves #19403
2025-03-02 18:17:38 -08:00
Nanda H Krishna
cf0b00a05c
rubocop/lines: prefer assert_path_exists and refute_path_exists 2025-02-18 10:52:32 -05:00
Patrick Linnane
797ccdd11c
brew style --fix
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2025-02-12 21:49:12 -08:00
BrewTestBot
a82bd70ff6
sorbet: Autobump sigils via Spoom
Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml) workflow.
2025-02-12 21:49:06 -08:00
Issy Long
bb56089fe7
Merge pull request #19277 from Homebrew/rm-old-todo
rubocops/lines: Clean up an old TODO
2025-02-11 11:00:03 +00:00
Issy Long
9359292db0
Retain the mis-ordered dependency case.
Co-authored-by: Carlo Cabrera <github@carlo.cab>
2025-02-11 10:28:52 +00:00
Issy Long
87b61a2317
Merge pull request #19195 from Homebrew/sorbet-strict-more-rubocops
More Sorbet `typed: strict` RuboCops
2025-02-10 22:37:56 +00:00
Issy Long
d9b376a9cd
rubocops/lines: Clean up an old TODO
- I considered writing a cop for this, but it's not worth it:
  there are no `[:test, :build]` occurrences in Core and this
  Rust rule only applies in Core formulae.
2025-02-09 18:33:27 +00:00
Issy Long
0fc1eb534b
More Sorbet typed: strict RuboCops
- Some of these I bumped to `typed: strict`, some of them I added
  intermediary type signatures to some of the methods to make my life
  easier in the (near, hopefully) future.
- Turns out that RuboCop node matchers that end in `?`
  can return `nil` if they don't match anything, not `false`.
2025-02-08 23:38:12 +00:00
Kristján Oddsson
7b01442273 make sure disable comments have content 2025-01-31 20:38:21 +01:00
Kristján Oddsson
d7af1e3527 add missing } 2025-01-31 20:20:00 +01:00
Kristján Oddsson
4acdcfcb37
Add a DisableComment Cop
Co-authored-by: Issy Long <issyl0@github.com>
2025-01-31 15:39:17 +01:00
Issy Long
867e982300
T.cast some Nodes to SendNodes
- In these cases we've already checked it's not a BlockNode,
  so we can safely cast to a SendNode and use `SendNode` methods.
2025-01-25 22:34:10 +00:00
Issy Long
06441f1337
Generic RuboCop::AST::Node for stanza method nodes
- These can be either BlockNode, SendNode or AsgnNode,
  which are all a type of Node.
- This causes errors in other places because we call
  BlockNode or SendNode methods on a Node now. Still TODO.
2025-01-25 22:20:08 +00:00
Issy Long
9a97456767
Bump more Cask RuboCops to Sorbet typed: strict
- This includes a new Tapioca compiler for
  `RuboCop::Cask::AST::Stanza` dynamic methods like
  `caveats?`.
2025-01-25 18:45:24 +00:00
Issy Long
94085ebb57
Bump more RuboCops to Sorbet typed: strict 2025-01-06 00:09:53 +00:00
Rui Chen
79ed2c6e61
chore: fix typos
Signed-off-by: Rui Chen <rui@chenrui.dev>
2024-12-28 15:53:35 -05:00
Sam Ford
79e20b3512
Standardize livecheck block language formatting 2024-12-02 10:13:04 -05:00