29 Commits

Author SHA1 Message Date
Patrick Linnane
4513a43d53
Fix RuboCop failures.
Co-authored-by: Patrick Linnane <patrick@linnane.io>
Co-authored-by: Carlo Cabrera <github@carlo.cab>
Co-authored-by: Thierry Moisan <thierry.moisan@gmail.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2025-07-14 19:12:38 +01:00
Mike McQuaid
9375fc21f4
requirements: set typed: strict 2025-06-17 16:34:59 +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
Mike McQuaid
6e9288470e
brew style --fix 2024-05-23 17:15:43 +01:00
Markus Reiter
caf87c0336
Warn about undocumented non-private APIs. 2024-05-01 11:35:20 +02:00
Markus Reiter
0f0055ede4
Make documentation @api private by default. 2024-04-26 19:04:20 +02:00
Markus Reiter
fe4ef62aa9
Hide #inspect in docs. 2024-04-26 13:20:05 +02:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
Nanda H Krishna
f03e462995
xcode_requirement: improve outputs 2023-03-07 14:12:40 -05:00
Douglas Eichelberger
4deb4c1813
Enable typing in Requirement classes 2023-02-15 14:22:03 +00:00
Markus Reiter
5be4c9b5e0 Upgrade typed sigils. 2020-11-25 17:04:19 +01:00
Markus Reiter
da9289eff0 Add more type signatures. 2020-11-13 12:26:36 +01:00
EricFromCanada
635233b37e requirements: reword inspect() to place tags at end
This more closely matches requirements' display in the DSL.
2020-11-01 15:20:02 -05:00
EricFromCanada
a232ac8b1e requirements: improve display in brew info 2020-11-01 15:20:02 -05:00
Michka Popoff
3aec8a0398 xcode_requirement: support linux
2020-10-12T21:29:03.7866574Z [31mError:[0m undefined method `latest_version' for OS::Mac::Xcode:Module
2020-10-12T21:29:03.7867686Z /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/requirements/xcode_requirement.rb:33:in `message'
2020-10-12T21:29:03.7868902Z /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-test-bot/lib/tests/formulae.rb:199:in `map'
2020-10-12T21:29:03.7870227Z /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-test-bot/lib/tests/formulae.rb:199:in `satisfied_requirements?'
2020-10-12T21:29:03.7871547Z /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-test-bot/lib/tests/formulae.rb:593:in `formula!'
2020-10-12T21:29:03.7873156Z /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-test-bot/lib/tests/formulae.rb:20:in `block in run!'
2020-10-12T21:29:03.7875029Z /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-test-bot/lib/tests/formulae.rb:19:in `each'
2020-10-12T21:29:03.7876299Z /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-test-bot/lib/tests/formulae.rb:19:in `run!'
2020-10-12T21:29:03.7877495Z /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-test-bot/lib/test_runner.rb:119:in `run_tests'
2020-10-12T21:29:03.7878705Z /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-test-bot/lib/test_runner.rb:36:in `block in run!'
2020-10-12T21:29:03.7879908Z /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/lib/ruby/2.6.0/delegate.rb:83:in `each'
2020-10-12T21:29:03.7881136Z /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/lib/ruby/2.6.0/delegate.rb:83:in `method_missing'
2020-10-12T21:29:03.7882519Z /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-test-bot/lib/test_runner.rb:25:in `run!'
2020-10-12T21:29:03.7883735Z /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-test-bot/lib/test_bot.rb:126:in `run!'
2020-10-12T21:29:03.7884875Z /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-test-bot/cmd/test-bot.rb:75:in `test_bot'
2020-10-12T21:29:03.7885882Z /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb:119:in `<main>'
2020-10-26 22:22:16 +01:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Markus Reiter
a9c271ddba Document XcodeRequirement. 2020-08-26 03:13:59 +02:00
EricFromCanada
5277f849d9 API: supply additional data for requirements 2020-03-03 15:00:33 -05:00
Mike McQuaid
01a3425502
Require Xcode 10.2 on macOS 10.14
Xcode >=10.2 is required to build all Swift formulae on macOS >=10.14.4.

Rather than requiring per-formula workarounds
(e.g. Homebrew/homebrew-core#39446) this provides a more stable platform
Homebrew can rely on for building Swift formulae.
2019-05-01 09:06:41 +01:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid
426c6e2c3f
xcode_requirement: fix Swift compatability check.
Ensure we're using the full macOS version so that
`MacOS::Xcode.version >= "10.14.4"` can ever be true.
2019-04-09 15:59:27 +01:00
Mike McQuaid
da392cd9e8
xcode_requirement: require macOS 10.14.4 for Xcode 10.2.
See discussion in https://github.com/Homebrew/brew/pull/5940.
2019-04-04 08:34:25 +01:00
Mike McQuaid
1aa8ad09e2
Deprecate macOS versions below Mavericks
And remove all dead/unneeded code.
2019-01-27 12:27:47 +00:00
Mike McQuaid
0c0275771d
Cleanup Requirements
- remove unused NonBinaryOsxfuseRequirement
- import CodeSignRequirement from Homebrew/homebrew-core
- remove unused UnsignedKextRequirement
- don’t allow custom name for X11Requirement
2018-10-19 16:38:41 +01:00
Markus Reiter
e9b9ea49a1 Update to RuboCop 0.59.1. 2018-09-17 03:45:59 +02:00
Mike McQuaid
c32865011d xcode_requirement: handle nil @version.
When the Xcode requirement doesn't specify a version then we need to
guard this check.
2018-02-09 19:37:15 +00:00
Mike McQuaid
1373441e53 xcode_requirement: inform users of macOS upgrade.
If you need a newer Xcode than the latest version provided by your
version of macOS then you need to upgrade your OS to install the
software.
2018-01-28 19:08:19 +00:00
Mike McQuaid
d54e670a64 requirements: move more to compat. 2017-12-30 20:56:55 +00:00
Mike McQuaid
38ce994007 Deprecate more requirements.
These are ones that were either already deprecated due to audit rules
or are just a simple `which` with a `default_formula` so should just
be a dependency.
2017-12-23 16:53:25 +00:00