122 Commits

Author SHA1 Message Date
Sam Ford
00249bda44
MacOSVersion: enable strong typing 2025-06-15 09:02:41 -04:00
Mike McQuaid
dc71b7c8f6
Cleanup extend/ directory usage.
- move some things out of `extend` that don't really fit there e.g.
  `Module`s that are included but not doing any
  overriding/monkeypatching
- move some code into `extend/os` to fix all remaining
  `rubocop:todo Homebrew/MoveToExtendOS`s
- remove some unneeded `bundle` skipper code that doesn't really make
  sense given our current bottling strategy
- extract some `Pathname` extensions to `extend/pathname` for separate
  files
- move a `ENV` `Kernel` extension into `kernel.rb`
- `odeprecate` a seemingly unused backwards compatibility method
- move `readline_nonblock` from a monkeypatch to a
  `ReadlineNonblock.read` method as its only used in one place
- fix up a link in documentation
2025-06-09 19:06:16 +01:00
Sam Ford
c495aa3e63
Cask::DSL::DependsOn: add empty?, present? methods
`#present?` is called on a `DependsOn` object in `Cask::DSL` and this
is seemingly deferred to the underlying hash object but Sorbet doesn't
understand this kind of `SimpleDelegator` magic. This adds `empty?`
and `present?` methods that explicitly interact with the hash in a
way that Sorbet can understand.
2025-04-22 18:07:09 -04:00
Mike McQuaid
c9a7b62b1d
Homebrew 4.5 deprecations/disables/removals
The usual cycle of deprecating, disabling, and removing things in
Homebrew major/minor releases.
2025-04-22 17:15:23 +01:00
Douglas Eichelberger
fcf18912fe
Inline use of attr_predicate 2025-03-02 21:36:03 -08:00
Issy Long
6ada9a9665
Add clarifying comments to rubocop:disables
- Needed for PR 18842 that adds a `DisableComment` RuboCop to ensure that all RuboCop disables have comments.
2025-01-12 16:59:07 +00: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
Bevan Kay
7e04c96c29
cask/dsl/caveats: fix rosetta caveat printing 2024-08-12 16:52:05 +10:00
Bevan Kay
b633dfd5a5
cask/dsl/caveats: fix conditional 2024-07-25 09:40:29 +10:00
Bevan Kay
a77a8ca564
cask/dsl/caveats: allow for simulated system checks in rosetta caveat 2024-07-09 15:42:38 +10:00
Issy Long
509fffab2b
Make more files Sorbet typed: strict
- According to Spoom, these could be bumped automatically with no errors.
2024-06-02 15:15:24 +01:00
Mike McQuaid
6e9288470e
brew style --fix 2024-05-23 17:15:43 +01:00
Mike McQuaid
222fe8ef0b
Homebrew 4.3.0 deprecation/disable/removals.
The usual pass of deprecating/disabling/removing code for the next
minor Homebrew release.
2024-05-07 12:18:04 +01:00
Razvan Azamfirei
0b0fcdcdd2
homebrew/cask-versions: remove 2024-05-02 16:59:33 -04: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
c76170a456
Hide #to_s in docs. 2024-04-26 14:04:55 +02:00
Douglas Eichelberger
c4db19232d git grep -lE '\(\&[A-Za-z._]+method\(:' | xargs gsed -i -E 's|\(\&([A-Za-z._]+)method\(:([a-z?_]+)\)\)| { \1\2(_1) }|g' 2024-03-03 18:55:56 -08:00
Douglas Eichelberger
e235bcf903 Add caveats.rbi 2024-01-31 22:23:40 -08:00
Douglas Eichelberger
f6c7eb7124 Add hash/keys to extend/ 2024-01-19 13:36:17 -08:00
Issy Long
f682147598
Fix RuboCop Style/RedundantFreeze offenses 2024-01-18 22:20:01 +00:00
Douglas Eichelberger
ffd761d2e9 Create dedicated Attrable mixin for attr_ methods 2023-12-28 11:46:27 -08:00
Rylan Polster
c21b8bd68a
Fix deprecation message
Co-authored-by: Bo Anderson <mail@boanderson.me>
2023-12-16 23:10:20 -05:00
Rylan Polster
7eb3f1a314
Replace discontinued? with deprecated? 2023-12-16 20:01:47 -05:00
Bo Anderson
5692c8ecbf
Fix style violations under newer RuboCop 2023-12-14 05:47:12 +00:00
Bo Anderson
b42256d286
Deprecate, disable & delete code for Homebrew 4.2.0 2023-12-07 23:42:13 +00:00
Mike McQuaid
7da934f7e2
Deprecate/disable/delete code.
The next release after this is merged will be 4.1.0.

Co-authored-by: Markus Reiter <me@reitermark.us>
2023-07-06 16:56:20 +01:00
Markus Reiter
8274920217
Rename OS::Mac::Version to MacOSVersion. 2023-05-09 05:08:38 +02:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
Markus Reiter
bdd6523ce8
Deprecate appcast. 2023-03-30 03:29:06 +02:00
Bevan Kay
68584ac7a7
dsl: pass #{arch} to flight blocks 2023-03-27 11:28:59 +11:00
Mike McQuaid
1e4abe2cc9
Merge pull request #15018 from dduugg/rm-hash-refinement
Use ActiveSupport Hash#assert_valid_keys instead of refinement
2023-03-20 13:48:47 +00:00
Douglas Eichelberger
92b99b3132 Remove misleading upstream.rbi, enable types in on_system 2023-03-19 19:41:46 -07:00
Douglas Eichelberger
4dcd5ac47f Remove HashValidator 2023-03-19 17:37:58 -07:00
Douglas Eichelberger
516c61057b Use ActiveSupport Hash#assert_valid_keys instend of refinement 2023-03-19 17:37:58 -07:00
Douglas Eichelberger
abfe29040b Enable types in Library/Homebrew/cask 2023-03-18 16:03:10 -07:00
Ruoyu Zhong
e9ce4a5a4e
Update path to system settings on Ventura
"System Preferences" has been renamed to "System Settings" on Ventura.
Privacy and security settings have moved, too. This commit makes sure
these changes are reflected. (Some adjustments were already made in
#14092.)

Signed-off-by: Ruoyu Zhong <zhongruoyu@outlook.com>
2023-03-17 19:24:07 +08:00
Douglas Eichelberger
04fa6e24d7 Enable more typing 2023-03-13 09:08:56 -07:00
Issy Long
6a704f2f40
sorbet: Bump more files to typed: true
- This was done through the `brew typecheck --suggest-typed --update`
  command.
2023-03-05 18:18:59 +00:00
Douglas Eichelberger
9958ab3ecf Make Cask::DSL::Container#pairs a derived property 2023-01-11 09:04:09 -08:00
moabits
b57cea84dd Fix style 2022-11-04 17:36:47 +01:00
moabits
a4bbdf8500 Update description for unsigned_accessibility caveat 2022-11-04 17:05:49 +01:00
Bo Anderson
31e97ca500
cask/dsl/depends_on: fix type signature 2022-11-01 20:49:16 +00:00
Sean Molenaar
94c0d8917e
fix: allow sparkle without a macOS version 2022-11-01 20:49:43 +01:00
Bo Anderson
9b99594753
Preliminary compatibility fixes for Ruby 3 2022-10-11 02:53:27 +01:00
Mike McQuaid
e7aa71de26
Remove odisabled for 3.6.0
The next release will be 3.6.0.
2022-08-23 11:25:02 +01:00
apainintheneck
c322f4fb90 cask/installer.rb: Stopped including Staged 2022-07-11 17:13:16 -07:00
Rylan Polster
ac067eedb2
Create MacOSVersions module 2022-06-29 11:34:49 -04:00
Mike McQuaid
1bb44979ee
Disable and delete code for 3.5.0
The next planned release will be 3.5.0 so let's fix things up for there.
2022-05-30 14:59:14 +01:00