9 Commits

Author SHA1 Message Date
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
Issy Long
768ef34bc2
Formula-Cookbook: Stop recommending rm_f in postinstall
- After all the work that went into
  https://github.com/Homebrew/brew/pull/17705, we
  don't want the docs disagreeing with what CI says
  the style should be.
2024-08-05 00:10:00 +01:00
Mike McQuaid
a707c708c1
Fix/reenable brew style docs
- start running this check again
- check the `docs` basename correctly
- use a different name (to a symlink) for the docs rubocop
  configuration so that path relativity is done correctly:
  https://docs.rubocop.org/rubocop/configuration.html#path-relativity
- add more wildcards to fix docs rubocop exclusions
2024-06-13 12:31:47 +01:00
Mike McQuaid
1b8bddd8bf
docs: brew style --fix 2024-06-13 09:55:31 +01:00
Mike McQuaid
ed0d6b7f61
docs: fix brew style 2024-06-12 19:17:17 +01:00
Issy Long
ca92fca770
Turn off FormulaAudit/{Desc,Homepage} for docs
- We don't need this blanket enabled, we only have a few docs where it actually matters that there's a description, it's just cruft having to invent descriptions.
2024-02-02 15:37:01 +00:00
Issy Long
bcd3a78f6d
Ignore the generated manpage; reinstate its trailing whitespace 2024-02-02 15:24:17 +00:00
Issy Long
3f5ae06ab1
Allow a longer Layout/LineLength for just the bottle blocks 2024-01-27 12:32:46 +00:00
Issy Long
00b47d1fec
Teach brew style about docs/.rubocop.yml
- Yes, we have yet another `.rubocop.yml` but in-line exclusions in
  `<span class="display:none;">` in the Markdown seemed more ugly.
- This needed tweaks to `brew style` to make it read the new config
  file when we're scanning docs.
2024-01-24 00:01:45 +00:00