356 Commits

Author SHA1 Message Date
Douglas Eichelberger
0add431e69 Apply manual violation fixes 2025-01-12 10:06:00 -08:00
Douglas Eichelberger
dbb731bce2 brew style --fix 2025-01-12 10:05:21 -08:00
Sean Molenaar
cb23433612
feat: only block cask install on Linux 2024-12-14 15:49:09 +01:00
Douglas Eichelberger
659f993dab Avoid exposing table 2024-12-08 10:28:10 -08:00
Douglas Eichelberger
6d19b84ef1 Fix args validation 2024-12-08 10:28:10 -08:00
Douglas Eichelberger
fef1211c19 Use method result table
foo
2024-12-08 10:28:10 -08:00
Douglas Eichelberger
3ea76b8498 Avoid re-defining #formula? 2024-12-08 10:28:09 -08:00
Douglas Eichelberger
3a4243742f Remove OpenStruct from CLI::Args 2024-12-08 10:27:49 -08:00
Caleb Xu
878d5d1633
hardware: rename none optimization flags to dunno 2024-11-16 14:44:37 -05:00
Caleb Xu
a70d15c80d
shared: only fall back to -march=native on supported architectures 2024-11-12 11:34:40 -05:00
Caleb Xu
33a9d24111
linux/hardware/cpu: add some missing AMD CPUs 2024-11-09 21:54:05 -05:00
Carlo Cabrera
017c8d05dc
linux/hardware/cpu: add some missing Intel CPUs
Information taken from 1bf385f102/llvm/lib/TargetParser/Host.cpp
2024-11-09 11:45:23 +08:00
Mike McQuaid
f5b211efaa
os/linux/diagnostic: remove XDG_DATA_DIRS. 2024-10-31 12:43:36 +00:00
Bo Anderson
97866f8adf
Perform preinstall checks when a formula is installed via a cask 2024-10-11 16:57:47 +01:00
Douglas Eichelberger
0855d7c9e0 Revert ENV changes 2024-10-05 12:35:28 -07:00
Douglas Eichelberger
f4a6dce64a Fix ENV 2024-10-05 12:18:29 -07:00
Douglas Eichelberger
0d5b56aa6a Fix tests 2024-10-05 12:18:29 -07:00
Douglas Eichelberger
eed660e784 Move remaining OS extensions to prepend 2024-10-05 12:18:29 -07:00
Douglas Eichelberger
61985bc7f3 Use top-level OS instead 2024-09-19 10:58:53 -07:00
Douglas Eichelberger
bb80f063dc Fix namespacing 2024-09-19 10:58:53 -07:00
Douglas Eichelberger
7cd329c116 Makes args readable 2024-09-19 10:58:53 -07:00
Douglas Eichelberger
27e951c408 Replace undef with prepended modules 2024-09-19 10:58:53 -07:00
Michael Cho
1dbedddc58
diagnostic: check for strings in XDG_DATA_DIRS 2024-08-17 21:59:49 -04:00
Douglas Eichelberger
df2fcfdfb0 Add missing sigs 2024-08-15 09:21:43 -07:00
Douglas Eichelberger
70b072a7d0 Suppress sorbet type errors when using `undef' 2024-08-15 08:03:45 -07:00
Carlo Cabrera
c42860cd3c
Merge pull request #18045 from Homebrew/linux-formula_installer-strict 2024-08-15 17:47:19 +08:00
Patrick Linnane
699d918d95
extend/os/linux/keg: use typed: strict
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2024-08-13 13:09:43 -06:00
Patrick Linnane
7e58233aaf
extend/os/linux/formula_installer: use typed: strict
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2024-08-13 12:56:01 -06: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
Issy Long
fc3c138cb0
extend/os/linux/cmd/update-report: Bump to Sorbet typed: strict 2024-08-10 23:55:14 +01:00
Issy Long
0e81efcccb
sorbet: Comment more files that can't be strict because of undef
- Found with
  `grep -rL "# typed: strict" Library/Homebrew | xargs grep -l "undef "`.
- This stops people from trying to bump them and
  getting an error that they can't fix because
  [it's a Sorbet limitation](https://sorbet.org/docs/error-reference#3008),
  wasting contributor time.
2024-08-09 18:23:00 +01:00
Adrian Ho
3eaebdc9d8
diagnostic: fix XDG_DATA_DIRS check
Pass `XDG_DATA_DIRS` through `bin/brew` so that it can be checked.
2024-08-05 09:11:01 +01:00
Carlo Cabrera
cc65e5419d
linkage_checker: remove gcc from @indirect_deps on Linux
Closes #17303.
2024-05-16 00:47:21 +08:00
Markus Reiter
480e264d9a
Lint Ruby docs. 2024-05-01 11:35:21 +02:00
Markus Reiter
caf87c0336
Warn about undocumented non-private APIs. 2024-05-01 11:35:20 +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
Mike McQuaid
8baed211a7
brew style --fix 2024-04-08 19:23:33 +01:00
Douglas Eichelberger
084f63ef22 Port Homebrew::DevCmd::UpdateTest 2024-03-22 09:33:28 -07:00
Michael Cho
2d884981c2
cleaner: add types
Signed-off-by: Michael Cho <michael@michaelcho.dev>
2024-03-11 11:46:23 -04:00
Mike McQuaid
ea2892f8ee
brew.rb: handle missing args. 2024-03-07 16:20:20 +00: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
Michael Cho
0ff2458952
extend/ENV/shared: effective_arch as public API 2024-01-13 15:26:38 -05:00
Patrick Linnane
9dee80cb2d
various: fix style errors 2023-12-18 09:34:01 -08:00
Bo Anderson
386fd0548a
Support system Ruby 3 on Linux 2023-11-07 19:27:30 +00:00
Bo Anderson
4ec450823c
Portable Ruby 3.1.4 (opt-in beta) 2023-10-27 15:58:43 +01:00
Steve Peters
94ef9a4b7a codesign in keg_relocate instead of keg methods
Currently the codesign_patched_binary method may be called many
times for the same file when installing a keg.

This removes the calls to codesign_patched_binary from os/mac/keg
and adds a single call to the relocate_dynamic_linkage and
fix_dynamic_linkage methods in extend/os/mac/keg_relocate
to speed up keg installation.
2023-09-09 18:14:28 -07:00
Michael Cho
bc2bb59726
extend/os/linux/system_config: show glibc/gcc version for API users 2023-08-26 22:19:32 -07:00
Douglas Eichelberger
d01cda2815 Turn up the types 2023-08-12 22:01:22 -07:00
Mike McQuaid
71888db8ba
bottle: reproducibility fixes.
I noticed from
https://github.com/Homebrew/homebrew-core/actions/runs/5751070010 that
we're no longer creating reproducible bottles between macOS and Linux.

All macOS checksums have changed but Linux ones have not. The main
difference between the two platforms is the `gtar` version used so let's
always just use the formula on both platforms.

While we're here, clear up the ordering and comments a little on the
reproducible `tar` arguments so that it's easier to compare with the
reproducible builds archives documentation.
2023-08-04 10:02:44 +01:00