24 Commits

Author SHA1 Message Date
botantony
4fa1355be0 deprecate!/disable!: remove non-typed replacement field
Signed-off-by: botantony <antonsm21@gmail.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2025-04-21 21:13:25 +02:00
botantony
ca447e1ce9 deprecate!/disable!: replacement_formula/replacement_cask fields
Signed-off-by: botantony <antonsm21@gmail.com>
2025-04-21 21:13:25 +02:00
botantony
e594e7e0bb deprecate!/disable!: allow to specify replacement type
Signed-off-by: botantony <antonsm21@gmail.com>
2025-04-21 21:13:25 +02:00
Michael Cho
21f35368eb
deprecate_disable: typed: strict 2024-12-20 13:33:16 -05:00
Caleb Xu
215fc85579
deprecate_disable: support optional replacement parameter 2024-11-08 15:49:00 -05:00
Markus Reiter
3342d5f99b
Fix message when disablement is in the past. 2024-08-14 21:31:01 +02: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
15f162c6ab
Output disable date for deprecated packages
Let's use the disable date, if provided, and use 1 year after the
deprecation date otherwise, to display a better message for the
various outputs of deprecated package messages.

Also, provide an internal API for this that can be used by
Homebrew/actions.
2024-07-14 11:49:44 -04:00
Markus Reiter
0f0055ede4
Make documentation @api private by default. 2024-04-26 19:04:20 +02:00
Justin Krehel
81b2377b12
deprecate_disable: add unsigned reason 2024-04-02 11:27:02 -04:00
Bevan Kay
3c0efa845a
deprecate_disable: add cask deprecation reason 2024-03-28 10:47:45 +11:00
Bevan Kay
013aba295a
deprecate_disable: add no_longer_meets_criteria deprecate/disable reason 2024-02-27 13:46:10 +11:00
Patrick Linnane
146451aeee
brew style --fix
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2024-02-25 10:13:26 -08:00
Bevan Kay
80d4488bbf
deprecate_disable: add cask deprecate/disable reasons 2024-02-25 19:58:35 +11:00
Rylan Polster
6431822e7b
Apply feedback 2023-12-16 20:18:35 -05:00
Rylan Polster
c5f33aaf99
Load nil reasons from API correctly 2023-12-16 20:01:47 -05:00
Rylan Polster
641a80475e
Update cask logic to handle deprecations and disables 2023-12-16 20:01:47 -05:00
Rylan Polster
036723a668
Add deprecate! and disable! methods to the Cask DSL 2023-12-16 20:01:46 -05:00
Mike McQuaid
2d5eab2e1c
brew style --fix 2022-06-30 08:56:21 +01:00
Michka Popoff
1ce7f1fb7b
disable: allow to disable due to checksum mismatch
The rationale is that a checksum mismatch is a huge security issue.
This means that the current source file, but maybe the initial one,
might have been compromised.

In the case upstream does not respond quickly to clarify what happened,
or fails to respond, we can now rev-bump the formula, disable and unbottle it,
making sure we stop delivering the potentially malicious code

Further improvements:
- Add the url of the project in the error message to redirect users to
the closed pull request where we disabled this, to centralize the discussion
and avoid the opening of multiple new issues
- Add a warning on brew-update that something is fishy upstream
2021-11-15 20:25:37 +01:00
Seeker
b9854bd4cf rubocops: add unless_multiple_conditions 2021-01-08 10:33:54 -08:00
EricFromCanada
3768b7a6e9 apidoc: update comment wording, punctuation, formatting 2020-11-06 00:21:02 -05:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Rylan Polster
a8bcd92628 deprecate_disable: refactor and add to info 2020-09-07 13:00:02 -04:00