334 Commits

Author SHA1 Message Date
Mike McQuaid
599db8cc95
Merge pull request #16642 from dduugg/rubocop-rspec-paths
Include all test paths in RSpec cops
2024-02-12 14:48:25 +00:00
Douglas Eichelberger
791ca27896 Add rubocop exclusion 2024-02-11 20:27:38 -08:00
Douglas Eichelberger
07fad780de Remove hidden defs references 2024-02-11 20:27:38 -08:00
Douglas Eichelberger
ee08fc53c1 Include all test paths in RSpec cops 2024-02-11 14:25:05 -08:00
Kevin
34882f51a8
Merge pull request #16577 from apainintheneck/exclude-more-tap-files-from-top-level-method-cop
rubocop: exclude more tap files from the top-level method cop
2024-02-03 16:59:29 -08:00
apainintheneck
648c50e9a6 rubocop: exclude more tap files from the top-level method cop
Basically, this started failing for me on my personal tap because
there are some methods defined at the top-level in my Rakefile.
That seems acceptable to me and since we're already ignoring all
other Ruby files in the tap I figured we might as well just ignore
all of them.

I ended up changing one other use of `Taps/**/*.rb` to `Taps/**/*.rb`
as well.
2024-02-03 16:44:36 -08:00
Issy Long
06028c204a
Merge pull request #16518 from issyl0/rubocop-md
rubocop: Try out `rubocop-md` for linting the code in our docs
2024-02-02 15:49:46 +00:00
Douglas Eichelberger
3a27cac7df
Merge pull request #16510 from dduugg/inverse-include-exclude-cop
Vendor remaining Rails cops, remove ActiveSupport
2024-01-30 11:59:10 -08:00
Douglas Eichelberger
bec27d44c6 Remove stray ActiveSupport references 2024-01-26 15:38:13 -08:00
Douglas Eichelberger
ae249ec282 Vendor InverseMethods cop 2024-01-26 15:03:59 -08:00
Douglas Eichelberger
0caaa1fa36 Vendor SafeNavigationWithBlank cop 2024-01-26 15:03:59 -08:00
Douglas Eichelberger
665bda0fbd Vendor Presence cop 2024-01-26 15:03:59 -08:00
Douglas Eichelberger
f99d39faf9 Vendor CompactBlank cop 2024-01-26 15:03:59 -08:00
Douglas Eichelberger
686264f1b0 Remove inline disables 2024-01-26 15:03:59 -08:00
Douglas Eichelberger
9d081a67cc Replace Rails/NegateInclude with Inverse/Invertible cops 2024-01-26 12:27:50 -08:00
Douglas Eichelberger
b6fef7b893 Add Taps exclusion 2024-01-26 12:25:47 -08:00
Douglas Eichelberger
36f64d6b30 Enable Style/TopLevelMethodDefinition 2024-01-26 11:37:11 -08:00
Issy Long
7c25ea6e3a
Configure RuboCop to use rubocop-md 2024-01-24 00:01:37 +00:00
Issy Long
a9d0d229f5
Add ~/Library/Containers to the list of Layout/LineLength exclusions
- This was found in https://github.com/Homebrew/homebrew-cask/pull/164915/files#r1460533604.
2024-01-20 19:36:07 +00:00
Issy Long
c63723bd7d
Merge pull request #16501 from issyl0/rubocop-new-rules-style-redundant-freeze
Fix RuboCop `Style/RedundantFreeze` offenses
2024-01-19 15:05:08 +00:00
Issy Long
bc5e422815
Merge pull request #16497 from issyl0/rubocop-new-rules-style-array-intersect
Fix RuboCop `Style/ArrayIntersect` offenses
2024-01-19 13:00:30 +00:00
Issy Long
f682147598
Fix RuboCop Style/RedundantFreeze offenses 2024-01-18 22:20:01 +00:00
Bo Anderson
ec0434c549
Tweak library load path insertion to be as early as possible 2024-01-18 14:54:14 +00:00
Issy Long
0e27dc2564
Fix RuboCop Style/ArrayIntersect offenses 2024-01-18 14:11:43 +00:00
Issy Long
592fcfd270
rubocop: The sorbet/rbi/todo.rbi file doesn't exist
- It got deleted in 89531e9ff36b84a47a078065e5d2ac9674dfbd2d but never cleaned up.
- The first cleanup from a tool I'm working on to check that all the paths in `rubocop.yml` Includes and Excludes do actually exist.
2024-01-15 18:52:06 +00:00
Mike McQuaid
dbb800b7d3
Merge pull request #16404 from dduugg/resolve-sorbet-violation 2023-12-27 08:01:41 +00:00
Douglas Eichelberger
a218ebb6ca Fix Sorbet/TrueSigil exclusion 2023-12-26 16:52:34 -08:00
Douglas Eichelberger
db869921e3 Remove irrelevant Rails cops 2023-12-26 13:10:18 -08:00
Issy Long
149b0e4f31
Fix new Style/MutableConstant RuboCop offenses for Ruby 3.1
- A follow-up to de592af20bbff5bcb548d2474f0722e59ff1129a, resetting the previous disabled comments too.
2023-12-16 11:57:06 +00:00
Bo Anderson
89531e9ff3
Update all dependencies 2023-12-15 16:24:46 +00:00
Issy Long
de592af20b
rubocop: Set TargetRubyVersion to 3.1 & disable all cops that fail
- As discussed in
  https://github.com/Homebrew/brew/pull/16337#issuecomment-1855668516,
  then we won't have the chicken/egg problem of fixing cops for syntax
  that's unsupported on Ruby 2.6 _before_ we set the TargetRubyVersion
  to 3.1, but if we set it too early then all the taps will fail.
2023-12-14 23:19:43 +00:00
Bo Anderson
5692c8ecbf
Fix style violations under newer RuboCop 2023-12-14 05:47:12 +00:00
Douglas Eichelberger
c36fafbcf2 Style fixes 2023-11-26 10:10:43 -08:00
Bo Anderson
daa49a1323
Install gems automatically on newer Ruby 2023-09-29 01:34:39 +01:00
Mike McQuaid
2243edaca3
rubocop: don't recommend minitest extension.
We don't use or need it.
2023-09-27 11:56:11 +01:00
Mike McQuaid
f73607553c
Cleanup various TODOs
These were also easily fixed, already fixed or incorrect and
non-controversial.

Co-authored-by: Issy Long <issyl0@github.com>
2023-09-03 09:12:41 -04:00
Issy Long
a1f855bb1b
rubocop: Revert PR 15312, unset EnabledByDefault
- This proved sufficiently controversial in the comments of https://github.com/Homebrew/brew/issues/15297.
- There are too many cops in this list that _don't_ make sense for us.
- For the few that do (with many thanks to Bo for going in depth to
  figure them out!), we can selectively enable them without using
  EnabledByDefault` and a whole load of `Enabled: false`.
2023-05-29 15:07:08 +01:00
Markus Reiter
46b9dba03c
Remove NoDslVersion cop. 2023-05-10 01:02:42 +02:00
Issy Long
0ea46b884b
Fix Rails cop enablement now EnabledByDefault is set
- These were `Enabled: false` for the whole group of Rails cops, so my
  removing the `Enabled: true` cops (what I thought was "redundant"
  config in the previous commit) meant the specific ones we wanted to
  use weren't enabled at all.
- Instead, let's reverse that by unsetting `Enabled: false` for the
  whole group, and then disabling the specific cops with offenses that
  we haven't got around to deciding if we care about yet.
2023-04-26 23:06:26 +01:00
Issy Long
d695c8a311
rubocop: Remove redundant Enabled: true config
- This is done by `EnabledByDefault: true` in the `AllCops` section.
2023-04-26 23:05:07 +01:00
Issy Long
6527fc2785
rubocop: Set EnabledByDefault: true, disabling cops with offenses
- `EnabledByDefault` is a feature of RuboCop that enables all cops even
  those marked `Enabled: false` in core RuboCop.
- I went through and disabled all the cops with offenses from this
  config change. This way we can do a piecemeal approach to enabling
  cops with offenses, while getting the benefits of the new cops with
  no offenses.
- It is intentional that `brew style` comes back green here and there
  are no code style fixes.
2023-04-26 23:02:39 +01:00
Douglas Eichelberger
bf8ac8a7b8 Simplify config 2023-04-25 09:26:24 -07:00
Douglas Eichelberger
cccbb5c705 Enable Style/InvertibleUnlessCondition cop 2023-04-25 09:26:24 -07:00
Douglas Eichelberger
e1f01c26ca Enable Sorbet/RedundantExtendTSig 2023-04-24 19:13:14 -07:00
Douglas Eichelberger
f7b18995c9 Disable Sorbet/FalseSigil 2023-04-21 09:57:25 -07:00
Douglas Eichelberger
e5fcdd0bd6 Enable Sorbet/TrueSigil cop 2023-04-19 09:43:36 -07:00
Issy Long
da734a30c2
Say yes to RuboCop's DisplayCopNames; fix test expectations
- Fixing the test expected output was unbelievably tedious.
- There's been debate about this setting being `false` but in
  https://github.com/Homebrew/brew/pull/15136#issuecomment-1500063225
  we decided that it was worth using the default since RuboCop behaviour changed
  so we'd have had to do some horrible things to keep it as `false` -
  https://github.com/Homebrew/brew/pull/15136#issuecomment-1500037278 -
  and multiple maintainers specify the `--display-cop-names` option to
  `brew style` themselves since it's clearer what's gone wrong.
2023-04-07 19:14:07 +01:00
Issy Long
61dc026fcc
rubocop: Remove the final Naming/MethodParameterName exceptions: pr
- Core RuboCop didn't want this shortening upstreamed, but that's OK!
2023-03-24 00:29:42 +00:00
Douglas Eichelberger
3018793f93 Remove OpenStruct use in Tab 2023-03-14 23:01:08 -07:00
Issy Long
cace5c429f
rubocop: Enable Style/AccessorGrouping and autofix offenses
- With RuboCop 1.48.1 this no longer reports offenses and applies bugged
  autocorrections for `attr`s with Sorbet `sig`s, so we can enable it.
2023-03-14 00:01:02 +00:00