17 Commits

Author SHA1 Message Date
Issy Long
268f801038
Bump more files to Sorbet typed: strict 2025-01-11 00:11:27 +00:00
Klaus Hipp
773242b936
Fix BundleVersion comparison when short_version is not comparable 2024-10-21 17:31:25 +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
Markus Reiter
0f0055ede4
Make documentation @api private by default. 2024-04-26 19:04:20 +02:00
Markus Reiter
a7cc9a8b41
Fix BundleVersion comparison. 2023-05-16 14:23:15 +02:00
Markus Reiter
8db7e44ea7
Always remove build from short_version. 2023-05-08 05:38:13 +02:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
Sam Ford
282c71d275
BundleVersion: Replace Nokogiri with REXML 2021-06-27 18:29:56 -04:00
Markus Reiter
a210b1a04e
Add extract_plist strategy. 2021-04-07 04:58:31 +02:00
Markus Reiter
a57813321b Fix BundleVersion comparison when one part is nil. 2021-03-28 04:15:59 +02:00
Markus Reiter
2a3ee11c07
Fix typo. 2020-12-19 19:34:22 -05:00
Markus Reiter
7dbb9b406b Fix type signatures in BundleVersion. 2020-12-15 15:37:40 +01:00
Markus Reiter
30c35659b6 Fix #nice_version. 2020-12-15 14:24:17 +01:00
Markus Reiter
7b9556db06 Remove trailing version from short_version. 2020-12-15 14:24:17 +01:00
Markus Reiter
7c6116af99 Remove fallback for BundleVersion. 2020-12-15 14:24:17 +01:00
Markus Reiter
849321cbff Prefer version for comparision of BundleVersions. 2020-12-15 14:24:17 +01:00
Markus Reiter
d2ff879496 Add BundleVersion class. 2020-12-15 14:24:17 +01:00