24 Commits

Author SHA1 Message Date
Patrick Linnane
cb15b67b8e
various: correct Style/CollectionQuerying
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2025-07-11 10:43:00 -07:00
Anton Melnikov
2f10b1cd6e
uninstall: style suggestions
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2025-05-21 17:54:21 +02:00
botantony
3dad44c9f3
uninstall: exclude configurational filess that belong to other formulae
Signed-off-by: botantony <antonsm21@gmail.com>
2025-05-21 17:05:51 +02:00
Ruoyu Zhong
f2cb33011a
uninstall: don't ignore deps even for developers
This was discussed a while back on Slack. The idea behind this is that
ignoring dependencies during `brew uninstall` makes it too easy to break
things, even for developers. Those who know what they are doing can, and
IMO should, always use the `--ignore-dependencies` flag.
2024-11-18 00:13:12 +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
Mike McQuaid
ea2892f8ee
brew.rb: handle missing args. 2024-03-07 16:20:20 +00:00
Douglas Eichelberger
09c679e75f Refactor module_function to reduce rbi need 2023-04-17 10:37:59 -07:00
Douglas Eichelberger
2073e70696 brew style --fix 2023-02-27 21:43:10 -08:00
Douglas Eichelberger
f9f73f3ef6 Tidy up 2023-02-27 21:42:47 -08:00
Douglas Eichelberger
1ab278f74c Fix style/type violations 2023-02-27 20:34:07 -08:00
Douglas Eichelberger
0eccc0e987 git grep -l Utils::Inflection | xargs gsed -i 's|Utils::Inflection|Utils|g' 2023-02-27 20:18:27 -08:00
Douglas Eichelberger
3da68651e5 Port more call sites 2023-02-27 20:18:08 -08:00
fn ⌃ ⌥
9b611be759 Print given argument instead of rename if matching keg not found 2021-11-24 11:39:52 -08:00
Nanda H Krishna
5ccfbcd1d2
Autocorrect style issues with brew style --fix 2021-07-08 12:36:39 +05:30
nandahkrishna
8e5451df2f
style: use parentheses for assignment in conditions 2021-02-12 18:33:37 +05:30
nandahkrishna
f7f9433443
Keg.find_some_installed_dependents: move to installed_dependents.rb 2021-02-12 01:42:17 +05:30
nandahkrishna
56ebffff7a
Refactor code to find dependents of kegs 2021-02-10 11:41:48 +05:30
nandahkrishna
7965ad6160
cmd/uninstall: check for dependent casks 2021-02-09 08:47:11 +05:30
EricFromCanada
cd3cb6928b indent suggested commands on subsequent line
and combine sequential puts calls
2021-01-26 15:36:44 -05:00
Markus Reiter
6e20d27582 Remove some unneeded requires. 2020-11-30 00:49:14 +01:00
Markus Reiter
f4b4fdac98 Add brew zap command. 2020-11-19 13:42:02 +01:00
Tie
b5427e5095 fix style issues 2020-11-04 18:53:03 -05:00
Tie
30a3561448 move uninstall logic to new file 2020-11-04 16:45:52 -05:00