Skip to content

Commit

Permalink
Add Rubocop exclusions for Rolify stuff
Browse files Browse the repository at this point in the history
Since adding Rolify, we are triggering two significant Rubocop offenses:

- `has_and_belongs_to_many` is frowned upon in favor of
  `has_many :through`, but Rolify still uses the former. There have been
  many attempts to resolve this (see the Rolify issues and PRs) over the
  past decade, but none have fully landed. It’s beyond us to try and
  wrestle this into existence, so we’re going to make an exception and
  move on.
- The HABTM join table has no timestamps, which is also frowned upon. We
  genuinely don’t care, however, and so are making an exception.

Issue #299
  • Loading branch information
reefdog committed Sep 20, 2022
1 parent f9a9cfd commit d3a4f3e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ AllCops:
# Join tables don't really need timestamps
Rails/CreateTableWithTimestamps:
Exclude:
# - 'db/migrate/20180128231930_create_organizations_and_events.rb'
- db/migrate/20220919194501_rolify_create_roles.rb

# Rails generates this file
Style/BlockComments:
Expand Down Expand Up @@ -64,6 +64,10 @@ Rails/HasManyOrHasOneDependent:

Rails/HasAndBelongsToMany:
Enabled: true
Exclude:
# Rolify uses HABTM. Despite a decade of the community attempting to implement
# `has_many: through`, it still struggles mightily with it. Let's make an exception.
- app/models/role.rb

Style/NumericPredicate:
Enabled: true
Expand Down

0 comments on commit d3a4f3e

Please sign in to comment.