18 Commits

Author SHA1 Message Date
Douglas Eichelberger
8763fb6d29 Resolve rubocop violations 2025-02-17 18:56:31 -08:00
Douglas Eichelberger
eed660e784 Move remaining OS extensions to prepend 2024-10-05 12:18:29 -07: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
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
Bo Anderson
71d51faa55
Introduce tag for implicit dependencies 2023-07-04 13:40:58 +01:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
Mike McQuaid
59f4b5226a
tests: test on Ubuntu 18.04. 2022-11-09 14:45:43 +00:00
Bo Anderson
66fa1f7e6a
Use GCC 12 for runtime libraries 2022-09-19 00:51:17 +01:00
Shaun Jackman
d6368806e8
os/linux/dependency_collector: install gcc if glibc is too old.
gcc is required for libgcc_s.so.1 if glibc or gcc are too old.
2022-08-31 13:16:38 +01:00
Mike McQuaid
1f709d360d
extend/os/linux: improve glibc, gcc dependency handling.
- Add more early return checks
- Move to a recursive approach for more readability and avoiding a
  counter that we need to bump
- Perform more caching
- Keep class variable usage isolated into specific methods
2022-08-30 12:54:34 +00:00
Mike McQuaid
3c5b55be82
linux/dependency_collector: bump maximum_tree_depth.
Fixes #13760.
2022-08-26 08:39:03 +01:00
Michka Popoff
d271614872
install glibc/gcc automatically if too old.
Right now this is done through the gcc@5 formula.
See 9692318ca6/Formula/gcc%405.rb (L33)

This is fragile because when we will migrate to gcc@11
we have to think about migrating the installation from one gcc formula to another..
Also, not having the right glibc version results in a non-functional brew
installation on an older Linux: the glibc installation needs
to be done by brew, and not by a workaround in a specific formula

Co-Authored-By: Mike McQuaid <mike@mikemcquaid.com>
Co-Authored-By: Bo Anderson <mail@boanderson.me>
Co-Authored-By: Shaun Jackman <sjackman@gmail.com>
2022-08-25 11:04:37 +01:00
Mike McQuaid
d6957a3acb
Homebrew 3.0.0 deprecations/disables 2021-01-29 19:50:24 +00:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Shaun Jackman
0ac5cbbda9 java_dep_if_needed: Install adoptopenjdk for Linux
Install adoptopenjdk rather than openjdk for Linux.
openjdk is superseded by adoptopenjdk.
2019-07-08 09:43:12 -07:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid
e095da4d01
rubocop: enable Layout/EmptyLineAfterGuardClause. 2019-02-21 12:55:49 +00:00
Shaun Jackman
d2dba5fc4a DependencyCollector: Add java_dep_if_needed [Linux]
Use the openjdk formula if it's installed.
Use the host's Java if it's sufficient.
Otherwise install the openjdk formula.
2018-11-11 10:18:24 -08:00