61 Commits

Author SHA1 Message Date
Eric Knibbe
cd6777fc73
audits: quote and reword problem description text 2025-05-30 23:49:26 -04:00
Patrick Linnane
797ccdd11c
brew style --fix
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2025-02-12 21:49:12 -08:00
BrewTestBot
a82bd70ff6
sorbet: Autobump sigils via Spoom
Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml) workflow.
2025-02-12 21:49:06 -08: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
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
Sam Ford
17b0493e18
Use struct for #audit_formula args
Adding type signatures to `#audit_formula` methods in formula cops
would lead to verbose, repetitive signatures across the existing ~63
instances. This reworks `#audit_formula` to use a `T::Struct` for its
arguments, which allows us to use a one-line signature for these
methods.
2024-07-08 12:22:25 -04:00
Sean Molenaar
48134ab674 feat: use shared checks for URL cop 2024-06-25 16:13:17 +02:00
Eric Knibbe
4932fb7fd0
rubocops/urls: remove dead link 2024-05-06 22:57:23 -04: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
Markus Reiter
0f0055ede4
Make documentation @api private by default. 2024-04-26 19:04:20 +02:00
Mahrud Sayrafi
eebffa8be3
audit(github): also permit refs/heads in GitHub URLs 2023-10-28 00:53:49 -05:00
Rui Chen
b954e20d12
audit(github): also need to consider commit artifact
Signed-off-by: Rui Chen <rui@chenrui.dev>
2023-10-23 14:58:03 -04:00
Rui Chen
a496f6708e
audit(github): prefer /archive/refs/tags urls over /archive
Signed-off-by: Rui Chen <rui@chenrui.dev>
2023-10-23 11:00:27 -04:00
Douglas Eichelberger
08af78a2a5 brew style --fix 2023-04-25 09:26:24 -07:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
Douglas Eichelberger
387d2f859f Use exclude_from_registry instead 2023-02-20 18:14:47 -08:00
Douglas Eichelberger
d9db5e8825 Refactor FormulaCop as a mixin 2023-02-20 18:14:47 -08:00
Douglas Eichelberger
6c93f6fe91 Enable typing in rubocops 2023-02-16 15:51:20 -08:00
Bo Anderson
6ede5d2dd5
rubocops: handle empty formula body in various cops 2022-11-05 04:40:16 +00:00
Issy Long
f8d9a5c2db
rubocops/urls: In regexps, only allow valid hostname characters
> This regular expression has an unrestricted wildcard '.*' which may cause 'googlecode\.com/files' to be matched anywhere in the URL, outside the hostname.
2022-04-15 16:45:41 +01:00
Issy Long
aa36b343ca
rubocops/urls: Escape .s in hostnames in regexps 2022-04-15 16:45:25 +01:00
Bo Anderson
629dbb7c59
rubocops/urls: allow plain HTTP mirrors 2021-10-01 13:42:05 +01:00
EricFromCanada
a427de5bee capitalization fixes
"curl" is the binary, while "cURL" is the umbrella project.
2021-01-26 15:36:44 -05:00
Rylan Polster
d59ce75d2a Migrate NOT_A_BINARY_URL_PREFIX_ALLOWLIST 2020-11-30 18:18:50 -05:00
Rylan Polster
7a8dd36003 Migrate BINARY_BOOTSTRAP_FORMULA_URLS_ALLOWLIST 2020-11-30 18:18:50 -05:00
Markus Reiter
da9289eff0 Add more type signatures. 2020-11-13 12:26:36 +01:00
EricFromCanada
3768b7a6e9 apidoc: update comment wording, punctuation, formatting 2020-11-06 00:21:02 -05:00
chenrui
f41afe6256
audit: use the specific url for vifm allowlist
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2020-11-02 09:10:44 -05:00
Rui Chen
ee0e9a86eb audit: bypass artifact check for vifm-osx-0.11
```
==> FAILED
Formula/vifm.rb:4:3: C: https://github.com/vifm/vifm/releases/download/v0.11/vifm-osx-0.11.tar.bz2 looks like a binary package, not a source archive; homebrew/core is source-only.
  url "https://github.com/vifm/vifm/releases/download/v0.11/vifm-osx-0.11.tar.bz2"
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
2020-11-01 17:25:50 -05:00
Jonathan Chang
1648011189 rubocops: permit openjdk@8 to bootstrap 2020-10-22 22:27:32 +11:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Rylan Polster
a91730316c style: only require tag for git urls with --strict 2020-10-03 15:51:30 -04:00
Rylan Polster
c84b5f985f style: require tag and revision for git urls 2020-10-03 12:27:01 -04:00
Markus Reiter
7630cee8e1 Document FormulaAudit::Urls. 2020-08-26 03:13:59 +02:00
Alexander Bayandin
8142bf2797 rubocop/urls: add go@1.14 to binary URLs allowlist 2020-08-12 15:35:20 +01:00
Rylan Polster
70dfaf3b42 Add link to pypi downloads page to problem message 2020-07-18 14:22:05 -04:00
Rylan Polster
5f3f7d010b Require long urls for pypi and pythonhosted urls 2020-07-18 14:05:46 -04:00
Mike McQuaid
fa760a2f26
Fix brew style. 2020-07-07 13:12:37 +01:00
Issy Long
0041ea21f5
Change occurrences of "whitelist" to "allowlist" 2020-06-06 22:38:32 +01:00
nandahkrishna
6f37dc4c41
livecheck: modified urls cop 2020-05-24 20:16:44 +05:30
Mike McQuaid
ca47992a6c
Fix rubocop-performance brew style. 2020-05-22 08:52:26 +01:00
Mathäus Zingerle
bb9665ced8 Migrate scheme checks for cvs, bzr, hg, fossil, and svn+http to Rubocop 2020-05-20 20:52:00 -05:00
Luke Lau
0500dd572c rubocops/urls: whitelist ghc@8.8 2020-04-30 15:05:14 +01:00
Mike McQuaid
37a79498a0
rubocops/urls: whitelist cspice.
As explained in https://github.com/Homebrew/brew/pull/7256#issuecomment-607787949
2020-04-03 13:53:03 +01:00
Mike McQuaid
ddaf467741
rubocops/urls: reorder for quicker scanning. 2020-04-03 13:52:44 +01:00
Mike McQuaid
9da6c9b521
rubocops/urls: stricter binary URL requirements.
Don't rely on x86_64 detection but instead whitelist the few projects
that fun afoul of these regex.
2020-04-02 09:54:14 +01:00
Bo Anderson
79811537fb rubocop/urls: add go@1.13 to binary URLs whitelist 2020-02-26 09:26:49 +00:00
EricFromCanada
29006396dd audit: check apache.org URLs 2020-02-24 13:07:46 -05:00
Mike McQuaid
ba52e7f932
rubocop/urls: remove deleted ghc@8.2. 2020-02-24 11:40:46 +00:00