32 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
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
Bo Anderson
1d7101d8a3
Use HOMEBREW_TEMP more universally 2024-02-26 16:58:53 +00:00
Issy Long
f4218a6316
Fix RuboCop Performance/MapCompact offenses
- Rename an iterator variable since it would make the line too long.
2024-02-25 22:59:59 +00:00
Douglas Eichelberger
eb7c3e52a0 Require SystemInclude only where needed 2024-01-31 11:42:01 -08:00
Douglas Eichelberger
0191af7899 resolve typecheck errors 2023-11-05 08:55:58 -08:00
Muescha
c447aa6d94
unversioned_cask_checker.rb - fix signature of KeyboardLayout
fix signature for KeyboardLayout
2023-08-06 21:30:45 +02:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
Markus Reiter
e57143542a
Consider dictionary stanzas in livechecks. 2023-04-04 05:06:58 +02:00
Markus Reiter
cf3054526a
Use select instead of flat_map. 2023-04-03 20:47:15 +02:00
Markus Reiter
6e5ab67838
Consider version of .apps containing installers. 2023-04-03 04:56:37 +02:00
Markus Reiter
cf7a9df923
Include screen savers in :extract_plist strategy. 2023-04-03 03:56:04 +02:00
Markus Reiter
f2da2c2020
Handle more artifacts in livecheck :extract_plist strategy. 2023-03-29 13:22:33 +02:00
Markus Reiter
471ce0b880
Use keyboard_layout stanza in livecheck. 2023-03-26 08:14:24 +02:00
Markus Reiter
f709a34d28
Look for all packages if specified packages are not found. 2023-02-21 14:06:33 +01:00
Bevan Kay
40fd8f7d78
unversioned_cask_checker: check installer artifacts 2022-12-05 14:26:38 +11:00
Bo Anderson
f5dc7a571f
Fix Style/ObjectThen offences 2022-06-17 19:47:55 +01:00
Bevan Kay
778d5df6d4
add qlplugins check to guess_cask_version 2021-07-22 19:36:50 +10:00
Bevan Kay
5040ec8142
fix style issues 2021-07-21 16:25:11 +10:00
Bevan Kay
212992a476
fix typecheck, add reference in bump-unversioned-casks 2021-07-21 16:09:09 +10:00
Bevan Kay
24c975f150
Update Library/Homebrew/unversioned_cask_checker.rb
Co-authored-by: Maxim Belkin <maxim.belkin@gmail.com>
2021-07-13 20:02:57 +10:00
Bevan Kay
b8a6cbe410
fix style 2021-07-07 17:40:35 +10:00
Bevan Kay
2af4254e82
unversioned_cask_checker: check for versions in qlplugins 2021-07-07 17:38:47 +10:00
Sam Ford
7835bcd10b
UnversionedCaskChecker: Replace Nokogiri with REXML 2021-06-27 18:29:57 -04:00
Markus Reiter
a210b1a04e
Add extract_plist strategy. 2021-04-07 04:58:31 +02:00
Markus Reiter
d9f472340d Add top_level_info_plists helper method. 2020-12-15 21:48:24 +01:00
Markus Reiter
d2ff879496 Add BundleVersion class. 2020-12-15 14:24:17 +01:00
Markus Reiter
e3818ee51e Fix parsing version from PackageInfo files. 2020-12-14 15:29:32 +01:00
Markus Reiter
cb2facfec1 Ignore Info.plist for nested apps. 2020-12-10 19:09:46 +01:00
Markus Reiter
05b496194a Fix version mapping. 2020-12-08 01:03:33 +01:00
Markus Reiter
c6876ba65c Add UnversionedCaskChecker helper class. 2020-12-07 23:03:47 +01:00