32 Commits

Author SHA1 Message Date
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
e98e668a34 remove redundant string extension 2023-01-28 08:26:11 -08:00
Bo Anderson
6ede5d2dd5
rubocops: handle empty formula body in various cops 2022-11-05 04:40:16 +00:00
Rylan Polster
ae89577b26
style: re-enable GitLab patch URL check 2021-04-19 11:19:35 -04:00
Rylan Polster
b5dec5fdbd
style: temporarily disable GitLab patch URL check 2021-04-19 09:13:06 -04:00
Jonathan Chang
ef1e07b88b
rubocops/patches: GitLab patches should use .diff
Only `.diff` URLs return output comparable to the diffs from
`git diff --full-index`. While the extra metadata from `.patch` is
nice, the instability of the patch contents is undesirable.

Co-Authored-By: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
2021-04-19 09:08:14 -04:00
Nanda H Krishna
1c2d76c4e4
rubocops/patches: remove autocorrection of some URLs 2021-04-17 01:44:28 +05:30
Issy Long
a328acc9a1
rubocops/patches: Fix quoting of the patch url when autocorrecting
- The autocorrections here before were leading to changes like:

```
➜ brew style --fix brewsci/science/beetl
Formula/beetl.rb:15:11: C: [Corrected] GitHub patches should use the full_index parameter: https://github.com/BEETL/BEETL/commit/ba47b6f9.patch?full_index=1
      url "https://github.com/BEETL/BEETL/commit/ba47b6f9.patch"
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

➜ git diff
diff --git a/Formula/beetl.rb b/Formula/beetl.rb
index bbd049aa..7ec6d7bc 100644
--- a/Formula/beetl.rb
+++ b/Formula/beetl.rb
@@ -12,7 +12,7 @@ class Beetl < Formula
     # Fixes "error: 'accumulate' is not a member of 'std'"
     # Upstream commit "Little fix for compilation on mac"
     patch do
-      url "https://github.com/BEETL/BEETL/commit/ba47b6f9.patch"
+      url https://github.com/BEETL/BEETL/commit/ba47b6f9.patch?full_index=1
       sha256 "63b67f3282893d1f74c66aa98f3bf2684aaba2fa9ce77858427b519f1f02807d"
     end
   end

```

- This fixes the URLs generated to have quotes:

```
➜ git diff
diff --git a/Formula/beetl.rb b/Formula/beetl.rb
index bbd049aa..7ec6d7bc 100644
--- a/Formula/beetl.rb
+++ b/Formula/beetl.rb
@@ -12,7 +12,7 @@ class Beetl < Formula
     # Fixes "error: 'accumulate' is not a member of 'std'"
     # Upstream commit "Little fix for compilation on mac"
     patch do
-      url "https://github.com/BEETL/BEETL/commit/ba47b6f9.patch"
+      url "https://github.com/BEETL/BEETL/commit/ba47b6f9.patch?full_index=1"
       sha256 "63b67f3282893d1f74c66aa98f3bf2684aaba2fa9ce77858427b519f1f02807d"
     end
   end
```
2021-04-16 19:41:02 +01:00
nandahkrishna
d68452f232
rubocops/patches: autocorrect some offenses 2021-03-04 12:36:18 +05:30
Jonathan Chang
df8e030174 rubocops/patches: use rubocop v1 API 2021-01-12 19:11:43 +11:00
Seeker
b9854bd4cf rubocops: add unless_multiple_conditions 2021-01-08 10:33:54 -08: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
Seeker
ea10192f8b rubocops/patches: GitHub/GitLab patches should end with .patch 2020-10-21 00:03:47 +11:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Mike McQuaid
8b97c27c21 brew style manual fixes 2020-09-01 14:26:45 +01:00
Dustin Rodrigues
de8cc4106a style: don't allow PR/MR urls for patches 2020-08-01 16:20:46 -04:00
Dustin Rodrigues
af3ea7d5aa Revert "style: don't allow PR/MR urls for patches"
This reverts commit 7a2483728c18e9cfb45e4b3f079687ec5a8e1503.
2020-07-28 21:20:46 -04:00
Dustin Rodrigues
7a2483728c style: don't allow PR/MR urls for patches 2020-07-28 10:18:26 -04:00
Frank Lam
ffb1cc8e19
Find patch nodes nested inside blocks 2020-06-27 03:13:50 +08:00
Frank Lam
afb8445380
Add inline patch checks to patches cop 2020-06-27 01:10:52 +08:00
Mike McQuaid
632813d969
rubocops/patches: reduce required revision length. 2020-04-13 16:01:26 +01:00
Alexander Bayandin
b37c3e9cb2 rubocops/patches: suggest url with full_index=1 2020-03-15 11:24:38 +00:00
Issy Long
9f80a7bce2
rubocops/patches: Make more GitHub patch locations enforce revisions
- We recently deleted a load of old Homebrew/formula-patches patches for
  non-existent core formulae
  (https://github.com/Homebrew/formula-patches/pull/283). This is a good
  action to take. Users should always be able to retrieve the patch once
  it's been deleted from the repo, if the formula they continue to use
  specifies a git revision to pull from, not just `master`.
- The code to detect `master` formulae was already here, so this adds
  another GitHub host to the detection: `raw.githubusercontent.com` as
  that's what the current patches that use `master`
  (https://github.com/Homebrew/homebrew-core/pull/51329) link to.
- Fixes https://github.com/Homebrew/homebrew-core/issues/51313.
2020-03-08 20:21:43 +00:00
Issy Long
1f6168fe8a
Change regexp.match?(string) to string.match?(regexp) everywhere
- Only try to call `.match?` on strings that aren't nil.
2019-10-13 23:22:51 +01:00
Issy Long
37fee928b5
Auto-fix Style/NegatedIf offenses 2019-10-13 16:04:35 +01:00
Issy Long
b78028b9c2
Auto-fix Performance/RegexpMatch offenses 2019-10-13 16:04:26 +01:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
EricFromCanada
89f0fcedbe whitespace fixes 2019-04-13 21:32:04 -04:00
Mike McQuaid
376eac2b8d
rubocops: rename files for consistency.
Make the filenames consistent with the class names.
2018-11-08 14:42:55 +00:00