173 Commits

Author SHA1 Message Date
Bevan Kay
2b151d30e7
rubocop: replace :unsigned automatically 2025-08-23 13:13:48 +10:00
copilot-swe-agent[bot]
7f6b4bee93
Implement SHA256 architecture audit as RuboCop rule
Co-authored-by: p-linnane <105994585+p-linnane@users.noreply.github.com>
Co-authored-by: MikeMcQuaid <125011+MikeMcQuaid@users.noreply.github.com>
2025-08-19 14:45:01 +01:00
Mike McQuaid
5602f0e11e
Merge pull request #20451 from Homebrew/dependabot/all-dbdec0a9b9
Bump the "all" group with 2 updates across multiple ecosystems
2025-08-14 09:10:26 +00:00
Patrick Linnane
2605529a90
brew style --fix 2025-08-13 12:23:12 -07:00
Bevan Kay
9cb2b65319
cask/dsl/rename: add new rename dsl 2025-08-12 23:24:20 +10:00
botantony
aecdcd4840
rubocops: add no_autobump! rubocop
Signed-off-by: botantony <antonsm21@gmail.com>
2025-06-18 16:16:12 +02:00
Eric Knibbe
ea8152757e
rubocops/cask/no_overrides: avoid nested depends_on macos: 2025-06-10 14:31:58 -04:00
Eric Knibbe
c75122c694
rubocops/cask/url: put keyword parameters on a new line 2025-06-05 10:53:34 -04:00
Eric Knibbe
0838ceda90
cask: document shell completion stanzas
Also, allow them to be given a `target:` parameter.
2025-05-09 14:47:26 -04:00
Issy Long
089680c76f
rubocops/cask/stanza_order: Ensure arch and os are adjacent
- Because Patrick wanted this to be codified.
2025-03-16 21:36:07 +00:00
Issy Long
0fc1eb534b
More Sorbet typed: strict RuboCops
- Some of these I bumped to `typed: strict`, some of them I added
  intermediary type signatures to some of the methods to make my life
  easier in the (near, hopefully) future.
- Turns out that RuboCop node matchers that end in `?`
  can return `nil` if they don't match anything, not `false`.
2025-02-08 23:38:12 +00:00
Issy Long
867e982300
T.cast some Nodes to SendNodes
- In these cases we've already checked it's not a BlockNode,
  so we can safely cast to a SendNode and use `SendNode` methods.
2025-01-25 22:34:10 +00:00
Issy Long
06441f1337
Generic RuboCop::AST::Node for stanza method nodes
- These can be either BlockNode, SendNode or AsgnNode,
  which are all a type of Node.
- This causes errors in other places because we call
  BlockNode or SendNode methods on a Node now. Still TODO.
2025-01-25 22:20:08 +00:00
Issy Long
9a97456767
Bump more Cask RuboCops to Sorbet typed: strict
- This includes a new Tapioca compiler for
  `RuboCop::Cask::AST::Stanza` dynamic methods like
  `caveats?`.
2025-01-25 18:45:24 +00:00
Issy Long
94085ebb57
Bump more RuboCops to Sorbet typed: strict 2025-01-06 00:09:53 +00:00
Rui Chen
79ed2c6e61
chore: fix typos
Signed-off-by: Rui Chen <rui@chenrui.dev>
2024-12-28 15:53:35 -05:00
Sam Ford
79e20b3512
Standardize livecheck block language formatting 2024-12-02 10:13:04 -05:00
Sam Ford
01cb74e525
livecheck: clarify livecheckable language
Formulae, casks, and resources have a `#livecheckable?` method that
indicates whether they contain a `livecheck` block. This is intended
to be read as "has a livecheckable?", not "is livecheckable?" (as
livecheck can find versions for some packages/resources without a
`livecheck` block). Unfortunately, correct understanding of this
method's behavior [outside of documentation] relies on historical
knowledge that few people possess, so this is often confusing to
anyone who hasn't been working on livecheck since 2020.

In the olden days, a "livecheckable" was a Ruby file containing a
`livecheck` block (originally a hash) with a filename that
corresponded to a related formula. The `livecheck` blocks in
livecheckable files were integrated into their respective formulae in
August 2020, so [first-party] livecheckables ceased to exist at that
time. From that point forward, we simply referred to these as
`livecheck` blocks.

With that in mind, this clarifies the situation by replacing
"livecheckable" language. This includes renaming `#livecheckable?` to
`#livecheck_defined?`, replacing usage of "livecheckable" as a noun
with "`livecheck` block", replacing "livecheckable" as a boolean with
"livecheck_defined", and replacing incorrect usage of "livecheckable"
as an adjective with "checkable".
2024-12-02 10:13:03 -05:00
Issy Long
f923ac574f
sorbet: Bump some Cask files to typed: strict 2024-11-26 00:25:06 +00:00
Douglas Eichelberger
ced4a3a91f Migrate Parlour extensions to Tapioca compilers 2024-10-14 19:50:09 -07:00
Rylan Polster
18147a6a1e
style: forbid url do blocks in homebrew/cask 2024-09-24 22:45:00 -04: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
Sean Molenaar
48134ab674 feat: use shared checks for URL cop 2024-06-25 16:13:17 +02:00
Sean Molenaar
bbd73a7243 feat: add shared checks for casks and formulae 2024-06-16 17:24:31 +02:00
Markus Reiter
480e264d9a
Lint Ruby docs. 2024-05-01 11:35:21 +02:00
Markus Reiter
caf87c0336
Warn about undocumented non-private APIs. 2024-05-01 11:35:20 +02:00
Justin Krehel
36cc201616
rubocops/cask/array_alphabetization: skip blank lines when sorting 2024-04-17 14:22:48 -04:00
Mike McQuaid
ea2892f8ee
brew.rb: handle missing args. 2024-03-07 16:20:20 +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
aab04229d1 Code review fixes 2024-02-11 20:27:39 -08:00
Douglas Eichelberger
c83e0170a9 Fix cask_help rbi 2024-02-11 20:27:38 -08:00
Douglas Eichelberger
b010e397d6 Add extend/node.rbi, remove unused methods 2024-02-11 20:27:38 -08:00
Douglas Eichelberger
b2dc842238 wip 2024-02-11 20:27:38 -08:00
Bevan Kay
bbebd3deec
Update shared_filelist_glob.rb
Co-authored-by: Kevin <apainintheneck@gmail.com>
2024-02-08 07:03:51 +00:00
Bevan Kay
60914a3f4f
rubocops/cask: fix style 2024-02-05 08:58:03 +01:00
Bevan Kay
2b60576165
rubocops/cask: add a cop for specific numbered shared file list files 2024-02-04 14:13:06 +01:00
Razvan Azamfirei
9aabe1ba91
rubocop: preserve comments when ordering uninstall methods 2024-01-28 07:08:48 -05:00
Razvan Azamfirei
db72295c20
rubocop: order uninstall methods 2024-01-28 07:08:47 -05:00
Douglas Eichelberger
8c832e0905 Remove some fixed FIXMEs 2024-01-26 12:00:13 -08:00
Issy Long
a6b8a795b4
Merge pull request #16365 from issyl0/rubocop-cask-zap-arrays-alphabetical
Add a new RuboCop for alphabetizing `zap trash` array elements
2024-01-24 21:34:18 +00:00
Issy Long
693a27d48b
Treat zap and uninstall the same
- Since `zap` can have more than just `trash`.
2024-01-21 19:48:30 +00:00
Issy Long
d5f9eef1b5
Empty line after guard clause, gah 2024-01-21 12:47:33 +00:00
Issy Long
458844af44
Move multi-line comments with the code they're 'attached' to
Co-authored-by: Bevan J. Kay <email@bevankay.me>
2024-01-21 12:42:22 +00:00
Issy Long
eec7a96fbe
Use Ruby 3.1's intersect\? method 2024-01-20 00:38:34 +00:00
Issy Long
e9bcb64000
Double quotes not single 2024-01-20 00:35:40 +00:00
Bevan J. Kay
779f1bba7d
Move comments in tandem with the lines they belong to 2024-01-20 00:03:34 +00:00
Issy Long
dae9b0cd53
very wip and bad comment handling 2024-01-18 12:53:23 +00:00
Issy Long
338e30ff9b
There are more arrays that contain non-alphabetizeable commands 2024-01-14 20:55:51 +00:00
Issy Long
6a1cb62b42
Appease RuboCop 2024-01-14 20:55:22 +00:00
Patrick Linnane
3fdba532a2
various: fix miscellaneous typos
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2024-01-12 10:56:49 -08:00