54 Commits

Author SHA1 Message Date
Bo Anderson
31c4116a78
debrew: migrate away from mutex_m 2025-04-15 23:02:00 +01:00
Douglas Eichelberger
fcf18912fe
Inline use of attr_predicate 2025-03-02 21:36:03 -08: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
Markus Reiter
0f0055ede4
Make documentation @api private by default. 2024-04-26 19:04:20 +02:00
Douglas Eichelberger
ffd761d2e9 Create dedicated Attrable mixin for attr_ methods 2023-12-28 11:46:27 -08:00
Bo Anderson
a92a36d027
Lazy load Debrew
Fixes terminfo error on some environments
2023-12-06 00:01:25 +00:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
Issy Long
5aa24832df
brew style --fix 2023-04-11 21:12:13 +01:00
Douglas Eichelberger
d1dfce578c Enable typing in Ignorable 2023-03-31 08:35:20 -07:00
Alexander Bayandin
d907a591a9
debrew: fix undefined variable 2023-03-14 11:09:57 +01:00
Issy Long
188466d28e
rubocop: Drop "e" from Naming/MethodParameterName allowlist 2023-03-09 21:58:57 +00:00
Bo Anderson
8b808308c2
Add ignorable module 2021-04-14 12:37:18 +01:00
Bo Anderson
a78051d2e0
debrew: make Debrew::Raise only catch uncaught exceptions 2021-04-07 13:41:41 +01:00
Seeker
b9854bd4cf rubocops: add unless_multiple_conditions 2021-01-08 10:33:54 -08:00
Markus Reiter
da9289eff0 Add more type signatures. 2020-11-13 12:26:36 +01:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Markus Reiter
23cbb79810 Document Debrew. 2020-08-26 03:13:58 +02:00
Markus Reiter
b1d0c61fea Update Gems. 2019-10-03 09:22:44 +02:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid
d1ea6f38d3
Fix mutable constants violations. 2019-04-19 21:46:20 +09:00
Mike McQuaid
80d75bc0d8
Homebrew/.rubocop: tweak rules.
Adjust the rules based on the current codebase. Remove various enable,
disables and default values that are unnecessary. Add more comments
explaining why. Make minor changes needed to enable a few more rules.
2018-09-02 20:15:09 +01:00
Markus Reiter
ad82cd888e Remove unneeded RuboCop comment. 2018-07-01 01:43:04 +02:00
Markus Reiter
175ca909ee Clean up code style and remove .rubocop_todo.yml. 2017-10-08 16:10:37 +02:00
Mike McQuaid
cf5fdeef1d Rubocop: manual rule fixes. 2017-09-24 21:23:59 +01:00
Markus Reiter
3b4ee58c49 Refactor using Forwardable and DelegateClass. 2017-06-28 09:25:31 +02:00
Markus Reiter
2d6ae61314 Re-revert "Fix operator spacing." 2017-06-02 19:22:05 +02:00
ilovezfs
197392b56d Revert "Fix operator spacing." 2017-06-01 04:06:40 -07:00
Markus Reiter
d34ba7395b Fix operator spacing. 2017-05-31 19:53:41 +02:00
Markus Reiter
6d8ee395fa Refactor Tty. 2016-10-01 20:00:49 +02:00
Markus Reiter
e851c9bf6c Style/Alias: Prefer alias. 2016-09-23 18:19:53 +02:00
Markus Reiter
52ff988530 Fix RuboCop CaseEquality. 2016-09-23 15:30:06 +02:00
Mike McQuaid
6693915399 rubocop --auto-correct all remaining files.
But remove some manual `.freeze`s on constants that shouldn't be
constants.
2016-09-17 16:14:13 +01:00
Xu Cheng
b121e5fd7b more core file style updated by rubocop 2015-08-06 17:23:56 +08: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
a52143c63c Remove readline and zlib hacks 2015-01-03 22:39:07 -05:00
Jack Nagel
0b8cf49386 Remove unnecessary code from debugger 2014-12-26 22:58:36 -05:00
Jack Nagel
d2d7516cc0 Allow debugging patching failures
Closes Homebrew/homebrew#33056.
2014-12-26 19:42:11 -05:00
Jack Nagel
ee2f3e8e7e Revert "Allow debugging patch failures"
This reverts commit 988601624568a951d86bd00cf441d18681b4b500.
2014-10-11 01:45:55 -05:00
Jack Nagel
8cc5aabfcf Allow debugging patch failures
Closes Homebrew/homebrew#33056.
2014-10-10 14:59:18 -05:00
Jack Nagel
84352d2728 Delay requiring irb until runtime
Fixes Homebrew/homebrew#32410.
2014-09-18 15:29:10 -05:00
Jack Nagel
c8bb68a795 Fix exiting the debugger menu with CTRL-D 2014-09-18 14:16:07 -05:00
Jack Nagel
79a6e59e6e Implement brew test --debug 2014-09-18 14:16:07 -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
35267d7c22 Disable "ignore" and "irb" debugger options unless we have a continuation
Fixes Homebrew/homebrew#30472.
2014-06-27 15:19:30 -05:00
Jack Nagel
502078099f Prefer self.class.name to self.class.to_s 2014-06-12 16:13:07 -05:00
Jack Nagel
d294d2e210 Fix the debug implementation of Resource#stage as well 2014-03-14 13:05:09 -05:00
Jack Nagel
1599e9b059 Fix Resource#stage method signature in debug mode
Fixes Homebrew/homebrew#27554.
2014-03-14 12:54:17 -05:00
Jack Nagel
d965bbba47 Allow the debugger to work from inside staged resources
References Homebrew/homebrew#23263.
Closes Homebrew/homebrew#27445.
2014-03-13 10:05:57 -05:00
Jack Nagel
0b425178ec Reduce footprint of readline hack 2013-02-07 19:02:20 -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