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.
- 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.
- 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.
- 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`.
- 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.
- `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.
- 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.