varvet / pundit

Minimal authorization through OO design and pure Ruby classes
MIT License
8.28k stars 630 forks source link

Update rubocop to most recent version #685

Closed Burgestrand closed 3 years ago

Burgestrand commented 3 years ago

I noticed #683 and #682 didn't fail the build even though they changed style, and our master branch hasn't failed either. If we have rubocop violations they should fail, and if we don't have violations in master I'd expect the PRs to fail since they don't change the configuration.

Through this I noticed that rubocop doesn't run for PRs. Hopefully this changes that.

Burgestrand commented 3 years ago

For #683 and #682 we're not failing the build because our templates aren't covered by Rubocop due to the ERB syntax.

dgmstuart commented 3 years ago
  • Run rubocop as part of default rake task

@Burgestrand this has the side effect of running the same rubocop check for each ruby version, which doesn't seem necessary? The cost is in longer build times.

Currently travis is configured to run rubocop once for only the default ruby version: https://github.com/varvet/pundit/blob/master/.travis.yml#L6-L10

...but maybe that's not working?

dgmstuart commented 3 years ago

@Burgestrand or... maybe I don't understand what's going on here: looking at the Travis build failure, rubocop doesn't seem to be running as part of the default rake task (which I think is a good thing), but is now correctly failing when we're explicitly running it in the Travis config.

I guess rubocop isn't running as part of the rake command because we have explicitly said that only spec should be run as the default task? https://github.com/varvet/pundit/blob/master/Rakefile#L20

I feel like I'm OK with the result, but I'm not sure if it's the result you intended?

Burgestrand commented 3 years ago

Closing this because there's no clear benefit, it's causing more trouble than expected and there are other things to prioritise in Pundit. If you're reading this and feel updating rubocop and make the tests pass is something you'd like to do, by all means feel free to pick up where I left off!