740 Commits

Author SHA1 Message Date
Eric Knibbe
f5c5d26173
cmd/dev-cmd: fetch HOMEBREW_EVAL_ALL for --eval-all 2025-07-03 12:59:12 -04:00
Mike McQuaid
55f65ec375
audit: ensure that official formula and cask names don't conflict.
Co-authored-by: Eric Knibbe <enk3@outlook.com>
2025-06-23 16:08:13 +01:00
Eric Knibbe
3dc9e88542
parser: show related env var in switch description 2025-06-03 13:57:42 -04:00
Douglas Eichelberger
fcf18912fe
Inline use of attr_predicate 2025-03-02 21:36:03 -08:00
Patrick Linnane
291edf5d30
docs: rewording
Co-authored-by: Carlo Cabrera <github@carlo.cab>
2025-02-05 13:39:27 +01:00
Eric Knibbe
99de228fc2
docs: various manpage grammar fixes 2025-02-05 13:38:39 +01:00
Douglas Eichelberger
ce9216e66c Fix use of tap 2024-12-08 10:28:10 -08:00
Issy Long
f854a9f3fc
dev-cmd/audit: Bump to Sorbet typed: strict 2024-07-01 19:11:17 +01:00
Mike McQuaid
16901a674f
extend/kernel: make opoo/odie/etc. print GitHub Actions notes.
We already do this for deprecations but these may make warnings
and errors from Homebrew easier to spot in GitHub Actions logs.

While we're here, cleanup other cases that should have used
`GitHub::Actions::Annotation` but didn't and provide some helpers and
tweaks there necessary for our use case here.
2024-05-09 14:43:53 +01:00
Kevin
c44e053847
Merge pull request #17242 from Homebrew/fix-cask-source-file-path-loading-issues
Fix cask source file path loading issues
2024-05-08 18:28:04 -07:00
Mike McQuaid
222fe8ef0b
Homebrew 4.3.0 deprecation/disable/removals.
The usual pass of deprecating/disabling/removing code for the next
minor Homebrew release.
2024-05-07 12:18:04 +01:00
apainintheneck
ffc503f1d0 Fix cask source file path loading issues
There are two big changes here. Both have to do with how we want
to load casks in different scenarios. One also is related to formulae.

1. Prevent loading casks & formulae outside of taps for specific commands.

There are certain commands like `bump`, `bump-*-pr`, `livecheck` and `audit`
where it really makes no sense to try and run things if the specified formulae
or cask is not in a tap. A new `#to_formulae_and_casks_with_taps` method was
added to the `CLI::NamedArgs` class to allow us to easily grab and validate
formulae and casks from named arguments.

2. Always load the source file path when loading casks with the path loader.

There was an edge case where all JSON cask files were being loaded without
setting the source file path because most of the work was handed off to the
API loader where that normally would make more sense. Now we set that when
calling the API loader which solves the problem. This improves the user
experience of people using the `--cache` and `fetch` commands in certain
edge cases. Hopefully it makes the user experience a bit more consistent.

A regression test was added for this point.
2024-05-06 23:34:23 -07:00
Mike McQuaid
aa6ea4be83
Call Homebrew.install_bundler_gems! more consistently.
- Call `Homebrew.install_bundler_gems!` as early as possible
- Always call `Homebrew.install_bundler_gems!` in `dev-cmd` rather than
  in `Library/Homebrew` helpers method (to ensure we don't accidentally
  call this for non-dev-cmd commands)
2024-04-30 10:39:35 +01:00
Douglas Eichelberger
c50fb2dbd2 Remove redundant cli/parser requires 2024-03-29 18:53:07 -07:00
Douglas Eichelberger
6b19bc5535 Style cleanup 2024-03-20 10:36:19 -07:00
Douglas Eichelberger
0f2efd3939 Port Homebrew::DevCmd::Audit 2024-03-20 10:16:17 -07:00
apainintheneck
fb8c0d2b30 s/Tap.select(&:installed?)/Tap.installed/ 2024-03-08 23:22:00 -08:00
Mike McQuaid
ea2892f8ee
brew.rb: handle missing args. 2024-03-07 16:20:20 +00:00
Markus Reiter
ab27efbd9d
Make Tap::each respect the API. 2024-02-22 17:56:47 +01:00
Bo Anderson
310b5ecbe7
Introduce Formulary platform cache 2024-01-09 11:12:49 +00:00
apainintheneck
b79778229c Resolve Cask::Cask.all todo
Now it takes the :eval_all parameter that means we can remove
ARGV handling inside Cask::Cask.all.
2023-12-21 21:55:16 -08:00
Bo Anderson
5692c8ecbf
Fix style violations under newer RuboCop 2023-12-14 05:47:12 +00:00
Bo Anderson
b42256d286
Deprecate, disable & delete code for Homebrew 4.2.0 2023-12-07 23:42:13 +00:00
Markus Reiter
0a4d10ba89
Deprecate --new-formula/--new-cask options. 2023-12-06 16:18:26 +01:00
Bo Anderson
3c9eb901db
dev-cmd/audit: fix for Ruby 3 2023-10-30 21:21:30 +00:00
Bo Anderson
26ea6b7f9e
Pull in REXML gem as it doesn't ship with Ruby 3 2023-10-27 20:24:10 +01:00
apainintheneck
5859fcce44 dev-cmd/audit: load formulae from files
This is a test to see if this will fix some flaky checks on CI
that are caused by missing formulae while auditing the core tap.

- https://github.com/Homebrew/brew/issues/16037
2023-09-26 20:37:41 -07:00
apainintheneck
d63e8cde80 cmd/audit: only flush formulary cache when needed
The cache here needs to be cleared when we are auditing multiple
os/arch combinations but not when we are running the audit only
for the current os/arch combination. This gives a 2x speed boost
to `brew audit --skip-style --except-version --tap=homebrew/core` locally.

In theory we could clear the cache less often by running all audits for
one os/arch combination at a time when auditing multiple os/arch combinations.
This would make the output a bit harder to follow and we don't seem to
run those checks on CI so I'm skipping that for now.
2023-09-09 18:47:29 -07:00
apainintheneck
1dc9274f62 Improve cask audit
- check for cask.url in audit steps
- check for cask.version in audit steps
- check for cask.sha256 in fetch command
- stop omitting casks based on nil url in audit command

It would be nice to be able to omit casks from the audit
if the os is not supported but there is not easy way to
do that without updating the SimulateSystem code or
refactoring how MacOSRequirement's are defined in the DSL.
2023-09-07 20:38:17 -07:00
apainintheneck
f4b15e95ac cmd/fetch & cmd/audit: handle unsupported os/arch combos
It's possible for casks to only run on certain os/arch
combinations but we don't check for them in the fetch and
audit commands.

At first, I tried to check if the macos version was satisfied
in a previous PR but that doesn't work correctly because
MacOSRequirement and ArchRequirement don't respect SimulateSystem.

Instead I'm just checking to see if the url stanza is defined
for each os/arch combination and skipping those casks where
it ends up being nil. This is kind of brute forcing it but
should work.
2023-09-04 15:00:31 -07:00
hyuraku
adc2a2fea1 remove ARGV from Formula#all 2023-09-02 19:35:22 +09:00
Mike McQuaid
7da934f7e2
Deprecate/disable/delete code.
The next release after this is merged will be 4.1.0.

Co-authored-by: Markus Reiter <me@reitermark.us>
2023-07-06 16:56:20 +01:00
Bo Anderson
367f716a08
dev-cmd/audit: don't audit every tap with given named packages 2023-07-04 16:08:04 +01:00
Bo Anderson
bb7aef85db
Migrate remaining no-api commands to new scoped system 2023-06-22 17:11:20 +01:00
Bo Anderson
68289f1165
Add without_api specifier for CLI named args 2023-06-22 01:57:28 +01:00
Carlo Cabrera
c5fe2a3559
formula_auditor: adjust deps audit for a staging branch
1. Adjust audit so that it ignore conflicts only for `brew audit --tap`.
   This is useful because it prevents us from trying to migrate a formula
   to `openssl@3` before all its dependencies have also been migrated.
2. Exempt only PRs that target a branch called
   `openssl-migration-staging`.
2023-06-20 22:37:06 +08:00
Markus Reiter
7cc1b6191e
Clean up brew audit output. 2023-05-19 19:40:37 +02:00
Markus Reiter
486c3765ce
Add --os=all and --arch=all options. 2023-05-17 15:26:46 +02:00
Markus Reiter
c5926241a8
Don't fail auditing empty tap. 2023-05-11 21:52:36 +02:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
Carlo Cabrera
f4692ddb40
dev-cmd/audit: fix audit annotations
Emitting annotations currently produces:

    Error: no implicit conversion of Symbol into Integer

The issue is that `problem` is an `Array` of problems which we need to
handle individually.
2023-04-22 15:13:35 +08:00
Mike McQuaid
2ca3f73078
dev-cmd/audit: remove unused warnings key.
These are now all errors so the code can be simplified.
2023-04-19 16:09:45 +01:00
Mike McQuaid
0b4c0350c2
Merge pull request #15201 from hyuraku/remove_cask/cmd/audit
remove `cask/cmd/audit`
2023-04-19 10:01:06 +01:00
hyuraku
54ce31e0fe remove auditing = true 2023-04-15 10:05:58 +09:00
hyuraku
98ec60c15e remove nil param 2023-04-13 19:02:20 +09:00
Markus Reiter
66d80cb114
Allow running audit for different architecture. 2023-04-12 21:46:48 +02:00
hyuraku
b8f18309c3 repair variable 2023-04-12 22:23:08 +09:00
hyuraku
acca57a2d8 repair cask_results query 2023-04-12 21:59:28 +09:00
hyuraku
f7b51d8cd1 pass opitions as named parameters 2023-04-12 20:16:10 +09:00
hyuraku
4999639140 - remove cask/cmd/audit
- repair cmd/audit
2023-04-11 23:06:01 +09:00