343 Commits

Author SHA1 Message Date
Mike McQuaid
7019df7481
Provide more leeway to file Tier 2/3 issues.
Let's still continue to tell people to not file some issues but allow
them to file others.

While we're here, let's me a bit more chill with the language here.
2025-06-27 15:27:26 +01:00
Rylan Polster
426da94cc9
Remove redundant xattr doctor check on systems without quarantine support 2025-06-24 03:07:04 +00:00
Rylan Polster
2acd4e4293
Improve messaging with missing xattr 2025-06-22 18:59:52 +00:00
Rylan Polster
12e5e24ce3
Improve brew doctor warnings about xattr and cask quarantine 2025-06-22 14:24:22 -04:00
Rylan Polster
e1873d30d4
Run deprecated cask tap check on all systems 2025-06-21 13:59:58 -04:00
Rylan Polster
031160936f
Split out os-specific cask software version checks 2025-06-21 13:59:57 -04:00
Mike McQuaid
9ac306e464
Remove alias generic_* definitions in favour of using super
This is the pattern we've been adopting for a while and it's a bit
cleaner. Let's remove all of the existing usage of the existing pattern
to avoid confusion when adopting the new one.
2025-06-16 08:10:08 +00:00
Mike McQuaid
d899f00c4b
Link to Support Tiers in diagnostic/error messages
Now that we have this nice URL let's reference it to allow our other
messages to be a bit shorter/kinder.
2025-04-01 11:35:27 +01:00
Adrian Ho
af49990b4f diagnostic: allow macFUSE FUSE3 files
FUSE 3 support was introduced in macFUSE 4.10.0.

Resolves #19650.
2025-03-30 21:41:16 +08:00
Mike McQuaid
bdeca530ff
Migrate Homebrew/bundle to Homebrew/brew
Co-authored-by: Bo Anderson <mail@boanderson.me>
2025-03-19 06:47:01 +00:00
Adrian Ho
86ec9c7c93 diagnostic: enforce user_path_1 prerequisite
Resolves #19447.
2025-03-10 10:14:47 +08:00
Mike McQuaid
7a5d4256e5
Fix Rubocop warnings (without brew style --fix) 2025-02-28 09:59:32 +00:00
Adrian Ho
571da49165 diagnostic: fix call to missing_dependencies
Followup to #19323.
2025-02-25 19:12:11 +08:00
Douglas Eichelberger
a81239ec2d
Enable strict typing in Formula 2025-02-24 10:23:42 -08:00
Adrian Ho
ce60f412e6 diagnostic: recommend untap where possible
Addresses #19334.
2025-02-21 00:27:59 +08:00
Mike McQuaid
7d41a93c76
diagnostic: skip duplicate formulae and casks check inside test-bot.
This makes the experience nicer for tap maintainers who may want to do
this but without hiding the actual warnings for users.
2025-02-19 08:38:31 +00:00
Adrian Ho
46b49ff34d diagnostics: add formula/cask dup check
Duplicate names across taps are a real pain to deal with, so let's warn the user.
2025-02-18 22:38:40 +08:00
Adrian Ho
872bb92639 Update Library/Homebrew/diagnostic.rb
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2025-01-19 23:19:03 +08:00
Adrian Ho
2d02c3950f diagnostic: elide stray filenames in subdirs
Usually, the subdirectory name is sufficient info, and the full file list is just noise.

This reduces `brew doctor` output clutter, making it easier for user to paste, and maintainers to parse.

Before:
```
$ brew doctor
[...]
Unexpected header files:
  /usr/local/include/node/cppgc/allocation.h
  /usr/local/include/node/cppgc/common.h
  /usr/local/include/node/cppgc/custom-space.h
  /usr/local/include/node/cppgc/garbage-collected.h
  /usr/local/include/node/cppgc/heap.h
  /usr/local/include/node/cppgc/internal/accessors.h
  /usr/local/include/node/cppgc/internal/api-constants.h
  /usr/local/include/node/cppgc/internal/compiler-specific.h
  /usr/local/include/node/cppgc/internal/finalizer-trait.h
  /usr/local/include/node/cppgc/internal/gc-info.h
  /usr/local/include/node/cppgc/internal/logging.h
  /usr/local/include/node/cppgc/internal/persistent-node.h
  /usr/local/include/node/cppgc/internal/pointer-policies.h
  /usr/local/include/node/cppgc/internal/prefinalizer-handler.h
[about 500 more files]
```
After:
```
$ brew doctor
Unexpected header files:
  /usr/local/include/node/...
```
The full list of stray files can still be viewed with `brew doctor -v`.
2025-01-19 23:19:03 +08:00
Douglas Eichelberger
2d16333bbc Replace removable constants with overridable methods 2024-10-07 18:33:03 -07:00
Mike McQuaid
94416e82f0
Add new odeprecated, odisabled, remove disabled code.
Prepare the usual deprecation cycle for Homebrew 4.4.0.
2024-09-24 10:15:34 +01:00
Issy Long
45978435e7
rubocop: Use Sorbet/StrictSigil as it's better than comments
- Previously I thought that comments were fine to discourage people from
  wasting their time trying to bump things that used `undef` that Sorbet
  didn't support. But RuboCop is better at this since it'll complain if
  the comments are unnecessary.

- Suggested in https://github.com/Homebrew/brew/pull/18018#issuecomment-2283369501.

- I've gone for a mixture of `rubocop:disable` for the files that can't
  be `typed: strict` (use of undef, required before everything else, etc)
  and `rubocop:todo` for everything else that should be tried to make
  strictly typed. There's no functional difference between the two as
  `rubocop:todo` is `rubocop:disable` with a different name.

- And I entirely disabled the cop for the docs/ directory since
  `typed: strict` isn't going to gain us anything for some Markdown
  linting config files.

- This means that now it's easier to track what needs to be done rather
  than relying on checklists of files in our big Sorbet issue:

```shell
$ git grep 'typed: true # rubocop:todo Sorbet/StrictSigil' | wc -l
    268
```

- And this is confirmed working for new files:

```shell
$ git status
On branch use-rubocop-for-sorbet-strict-sigils
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        Library/Homebrew/bad.rb
        Library/Homebrew/good.rb

nothing added to commit but untracked files present (use "git add" to track)

$ brew style
Offenses:

bad.rb:1:1: C: Sorbet/StrictSigil: Sorbet sigil should be at least strict got true.
^^^^^^^^^^^^^

1340 files inspected, 1 offense detected
```
2024-08-12 15:24:27 +01:00
apainintheneck
1fe16a5e35 Address feedback
- Move HOMEBREW_TAP_DIRECTORY to startup/config.rb because this file
holds more of the directory constants
- Rename `Commands.cmd_directories` to `Commands.tap_cmd_directories`
to better express that the commands come from taps

This file has the directory constants while the other one has regexes.
Just better organization.
2024-08-10 17:52:26 -07:00
apainintheneck
a3e917afe1 Refactor method to remove extra tap requires
We were selectively requiring the tap.rb file in a few places for
performance reasons. The main method we were referencing was the
`Tap.cmd_directories` method which uses `Pathname` and the `TAP_DIRECTORY`
constant internally. `Tap.cmd_directories` is mostly used in the `Commands`
module and that is loaded very early on in the program so it made sense
to move that command to that module. To facilitate that I moved the
`TAP_DIRECTORY` constant to the top-level and renamed it to
`HOMEBREW_TAP_DIRECTORY`. It now lies in the tap_constants.rb file.

A nice bonus of this refactor is that it speeds up loading external
commands since the tap.rb file is no longer required by default in
those cases.
2024-08-10 13:49:10 -07:00
Mike McQuaid
b8ff4b3d23
Widen attestation verification rollout
Take 2 of https://github.com/Homebrew/brew/pull/17692 but with:

- provide and document `HOMEBREW_NO_VERIFY_ATTESTATIONS`
- don't try to run unless there's GitHub credentials
- don't try to run unless `gh` is installed
- don't try to run in CI

While we're here:
- split out a `Homebrew::EnvConfig.devcmdrun?` helper method
- add some missing `Homebrew::EnvConfig.github_api_token` presence
  checks
2024-07-14 11:50:57 -04:00
Mike McQuaid
616646a1df
diagnostic: fix cask taps doctor output.
A fix for the previous fix broke the fix.
2024-06-11 10:23:39 +01:00
Mike McQuaid
68c5d616c2
diagnostic: don't show cask taps with no casks.
This avoids displaying a bunch of non-cask taps here.
2024-06-11 09:57:07 +01:00
Mike McQuaid
c13700af00
Use repository consistently instead of repo
The documentation linting job doesn't like `repo` so let's fix this
globally rather than naming it differently in documentation and code.
2024-06-10 09:31:53 +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
Markus Reiter
480e264d9a
Lint Ruby docs. 2024-05-01 11:35:21 +02:00
Markus Reiter
0b56d0be4a
Document Tab.for_keg and use Keg#tab where possible. 2024-04-28 20:50:13 +02:00
Markus Reiter
0f0055ede4
Make documentation @api private by default. 2024-04-26 19:04:20 +02:00
Douglas Eichelberger
c59d9fa833 Prefer numbered block params over proc conversion, cont'd 2024-04-08 09:47:27 -07:00
Bo Anderson
28a80a6ebf
Avoid writable_real? 2024-03-27 06:26:32 +00:00
Michael Cho
697d41674c
Merge pull request #16879 from cho-m/diagnostic-taploader
diagnostic: use FromTapLoader to check 3rd-party formula
2024-03-14 02:16:31 -04:00
Michael Cho
495bdd0d7a
diagnostic: rename variable to tap_keg_name
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2024-03-12 10:41:06 -04:00
Michael Cho
15dd3317f8
diagnostic: use FromTapLoader to check 3rd-party formula
Signed-off-by: Michael Cho <michael@michaelcho.dev>
2024-03-11 22:00:17 -04: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
a24da6b072
Remove FromDefaultNameLoader to avoid warning twice. 2024-03-06 23:14:28 +01:00
Issy Long
f4218a6316
Fix RuboCop Performance/MapCompact offenses
- Rename an iterator variable since it would make the line too long.
2024-02-25 22:59:59 +00:00
Markus Reiter
e0743a1436
Reapply "Refactor Formulary::loader_for."
This reverts commit 24683525cb5abf3cc79a9e0e268fa6efd0af558b.
2024-02-22 18:24:57 +01:00
Markus Reiter
ab27efbd9d
Make Tap::each respect the API. 2024-02-22 17:56:47 +01:00
Mike McQuaid
89fd6964f9
Merge pull request #16715 from reitermarkus/tap-ensure-installed
Clean up `Tap#ensure_installed!` usage.
2024-02-22 08:47:48 +00:00
Markus Reiter
9f5e1f2870
Clean up Tap#ensure_installed! usage. 2024-02-21 03:21:02 +01:00
Markus Reiter
7f5a67917a
Ensure CoreCaskTap is included in diagnostics. 2024-02-20 20:44:02 +01:00
Markus Reiter
4cf0f79368
Support Tap#cask_files when using API. 2024-02-20 20:44:02 +01:00
Mike McQuaid
24683525cb
Revert "Refactor Formulary::loader_for." 2024-02-16 13:41:54 +00:00
Markus Reiter
efa6130a66
Use FromDefaultNameLoader for diagnostics. 2024-02-15 01:37:43 +01:00
Markus Reiter
b717f5d954
Remove unused TapFormulaWithOldnameAmbiguityError. 2024-02-14 22:56:25 +01:00