19 Commits

Author SHA1 Message Date
Mike McQuaid
85c5f8f3a5
debrew: set typed: strict 2025-06-17 16:33:58 +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
Bo Anderson
53a547d446
debrew/irb: fix errors under Ruby 3.3 2024-08-03 01:18:22 +01:00
Markus Reiter
0f0055ede4
Make documentation @api private by default. 2024-04-26 19:04:20 +02:00
Bo Anderson
56a72fe2b1
debrew/irb: fix trap handling 2021-04-14 12:37:25 +01:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Markus Reiter
c2a0ba8e87 Enable rubocop-sorbet. 2020-10-09 16:45:13 +02:00
Alexander Bayandin
bd2724fa18 debrew: fix irb start 2020-08-17 15:02:04 +01:00
Bo Anderson
311a6f5d55 debrew/irb: don't attempt (and choke) documenting 2020-07-16 02:53:26 +01:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Markus Reiter
175ca909ee Clean up code style and remove .rubocop_todo.yml. 2017-10-08 16:10:37 +02:00
Mike McQuaid
01e9ec9a9f Rubocop: automatic rule fixes. 2017-09-24 21:23:59 +01:00
BrewTestBot
13d544e11e Core files style updates.
Closes Homebrew/homebrew#42354.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-03 13:22:35 +01:00
Jack Nagel
b149580632 Silence method redefinition warning 2015-03-10 23:25:31 -04:00
Jack Nagel
764d8b676d Simplify IRB monkeypatch 2014-10-05 23:01:02 -05:00
Jack Nagel
3bbc9998a5 Rewrite debugger to remove monkeypatches and use of call/cc 2014-09-18 14:16:07 -05:00
Jack Nagel
d547102253 debrew: restore ARGV even when IRB.setup raises 2013-02-07 22:31:05 -06:00
Jack Nagel
4515803474 Add tests for raise monkey patch 2013-02-06 19:04:43 -06:00
Jack Nagel
a75dd6e8a8 Split debrew up to faciliate test isolation
We want to be able to test the raise functionality without
monkey-patching #raise on every object in the system, which is one of
the side effects of loading debrew.rb.
2013-02-06 19:04:43 -06:00