diff --git a/CHANGELOG.md b/CHANGELOG.md index b867c724..57a4aa85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,17 @@ Features - Removes enumerize in favor of built-in enums [#428](https://github.com/platanus/potassium/pull/428) - Add linter rule to enforce the use of named exports [#427](https://github.com/platanus/potassium/pull/427) + - Enable new rubocop rules [#429](https://github.com/platanus/potassium/pull/429) +
+ See rules + + - [Rails/Delegate](https://docs.rubocop.org/rubocop-rails/2.17/cops_rails.html#railsdelegate) + - [Rails/I18nLocaleAssignment](https://docs.rubocop.org/rubocop-rails/2.17/cops_rails.html#railsi18nlocaleassignment) + - [Rails/WhereEquals](https://docs.rubocop.org/rubocop-rails/2.17/cops_rails.html#railswhereequals) + - [Rails/WhereNot](https://docs.rubocop.org/rubocop-rails/2.17/cops_rails.html#railswherenot) + - [Rails/RedundantPresenceValidationOnBelongsTo](https://docs.rubocop.org/rubocop-rails/cops_rails.html#railsredundantpresencevalidationonbelongsto) + - [Layout/ClassStructure](https://docs.rubocop.org/rubocop/1.24/cops_layout.html#layoutclassstructure) +
## 6.7.0 diff --git a/lib/potassium/assets/.rubocop.yml b/lib/potassium/assets/.rubocop.yml index 750999c0..6b8fa693 100644 --- a/lib/potassium/assets/.rubocop.yml +++ b/lib/potassium/assets/.rubocop.yml @@ -282,6 +282,59 @@ Style/SymbolArray: Layout/ExtraSpacing: Description: Do not use unnecessary spacing. Enabled: false +Layout/ClassStructure: + Enabled: true + Categories: + validation: + - validate + - validates + association: + - belongs_to + - has_one + - has_many + - has_and_belongs_to_many + attribute_macros: + - attribute + - attr_accessor + - attr_reader + - attr_writer + callbacks: + - before_validation + - after_validation + - before_save + - before_create + - after_create + - after_save + - after_commit + - after_create_commit + other_macros: + - devise + - acts_as_token_authenticatable + - accepts_nested_attributes_for + - humanize + - monetize + scope: + - scope + - pg_search_scope + ExpectedOrder: + - module_inclusion + - constants + - public_attribute_macros + - association + - validation + - enum + - aasm + - scope + - public_delegate + - other_macros + - class_methods + - initializer + - public_methods + - protected_attribute_macros + - protected_methods + - private_attribute_macros + - private_delegate + - private_methods Naming/AccessorMethodName: Description: Check the naming of accessor methods for get_/set_. Enabled: false @@ -498,7 +551,15 @@ Lint/StructNewOverride: Enabled: true Rails/Delegate: Description: Prefer delegate method for delegations. - Enabled: false + Enabled: true +Rails/I18nLocaleAssignment: + Enabled: true +Rails/WhereEquals: + Enabled: true +Rails/WhereNot: + Enabled: true +Rails/RedundantPresenceValidationOnBelongsTo: + Enabled: true Performance/RedundantBlockCall: Description: Use `yield` instead of `block.call`. Reference: https://github.com/JuanitoFatas/fast-ruby#proccall-vs-yield-code