22 Commits

Author SHA1 Message Date
botantony
1791c2e2a6
tap_auditor: do not audit autobump.txt in official taps
Signed-off-by: botantony <antonsm21@gmail.com>
2025-04-29 22:38:14 +02:00
Michael Cho
40cecdf8b4
tap_auditor: check renamed formula exists 2024-11-09 12:02:03 -05:00
Michael Cho
3d9590531e
tap_auditor: check formulae names in autobump.txt 2024-10-09 14:27:21 -04: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
Markus Reiter
0f0055ede4
Make documentation @api private by default. 2024-04-26 19:04:20 +02:00
apainintheneck
6e0e78cadd tap: CoreCaskTap#cask_tokens should always return short names
This seems to be a bug with how we handle name shortening for the
core cask tap. The core tap always returns short formula names
and returning long names from the core cask tap when not using
the API leads to unexpected behavior.

Specifically this can trick the `brew untap` command into thinking
that there aren't any installed casks in the core cask tap and that
it can be removed even when that is not the case.

One risk here is that the full names were used when caching
descriptions so descriptions could be out of date for people in
the short term though hopefully that's not the end of the world.
2024-03-09 18:59:31 -08:00
Mike McQuaid
ea2892f8ee
brew.rb: handle missing args. 2024-03-07 16:20:20 +00:00
Markus Reiter
b6c061ad18
Audit taps for duplicates in aliases/renames. 2024-02-08 16:36:10 +01:00
Bo Anderson
8045ed959a
tap_auditor: fix API data getting mixed in 2023-07-04 16:08:53 +01:00
Bo Anderson
5652655304
tap_auditor: fix alias handling with non-core taps 2023-06-10 00:52:39 +01:00
Markus Reiter
7cc1b6191e
Clean up brew audit output. 2023-05-19 19:40:37 +02:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
Carlo Cabrera
18722901ee
formula_auditor: create a versioned formula dependent conflict allowlist
We have an audit that checks each formula's dependency tree for multiple
versions of the same software. We have an allowlist that allows us to
ignore this audit, but this allowlist requires each formula with a
conflict in its dependency tree to be listed there.

Here, I propose the reverse: if formula `foo` appears in the
`versioned_formula_dependent_conflicts_allowlist`, then all its
dependents will not fail the versioned dependencies conflict because of
a conflict with formula `foo`.

I'd like to do this in the case of `python`, where I think the versioned
dependencies conflict check hurts us more than helps us. Versioned
dependency conflicts are most problematic in the case of libraries with
the same install name but incompatible ABIs. This is almost never a
problem with Python: almost no formulae link with the Python framework
on macOS (in part due to one of our audits that disallows Python
framework linkage in Python modules). Moreover, the various Python
frameworks that we ship have the version in the install name.

The above _might_ be a problem on Linux, since we allow unrestricted
linkage with `libpython`. However, we don't even check versioned
conflicts on Linux, so we aren't as concerned about this in the first
place.

This is also a lot more convenient than adding the dependents of some
Python formula one by one as they acquire conflicts due to changes in
other formulae.

I've also amended `tap_auditor` to allow the use of formula aliases in
an allowlist, to allow us to add `python` to this allowlist instead of
each individual versioned Python formula.

See also discussion at Homebrew/homebrew-core#108307.
2022-08-18 15:40:54 +08:00
Rylan Polster
05fa1f0cb8
tap_auditor: use short names when checking exception lists 2021-08-20 02:36:14 -04:00
Rylan Polster
da29827a87 audit: cleanup shared audit exception handling 2020-12-22 10:51:29 -05:00
Rylan Polster
ec4fe89a94 audit: migrate shared audits to taps 2020-12-21 14:45:02 -05:00
Rylan Polster
80a46edee4 tap: add style_exceptions configuration 2020-11-30 18:18:49 -05:00
Rylan Polster
ee47b863c4 move mapping from formula_lists to pypi_formula_mappings 2020-11-24 15:40:15 -05:00
Rylan Polster
51a1b7c9e1 move pypi list to tap formula_lists directory 2020-11-24 15:40:15 -05:00
Jonathan Chang
7330b4a6cc tap_auditor: widen type for constructor
We don't always pass `--strict`.
2020-11-20 22:20:34 +11:00
Markus Reiter
dc11f02e16 Move auditor classes into separate files. 2020-11-18 11:22:27 +01:00
Markus Reiter
04272f5f68 Move TapAuditor into separate file. 2020-11-18 10:25:32 +01:00