Skip to content

Commit

Permalink
Add new Rails/IndexNames cop
Browse files Browse the repository at this point in the history
  • Loading branch information
corsonknowles committed Oct 22, 2024
1 parent f66b8f7 commit a8447fc
Show file tree
Hide file tree
Showing 7 changed files with 882 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog/new_merge_pull_request_1378_from.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* [#1378](https://github.com/rubocop/rubocop-rails/pull/1378): Add new `Rails/IndexNames` cop. ([@corsonknowles][])
6 changes: 6 additions & 0 deletions config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,12 @@ Rails/IndexBy:
VersionAdded: '2.5'
VersionChanged: '2.8'

Rails/IndexNames:
Description: 'Checks for and removes custom index names. Since 7.1, Rails can ensure unique index names without exceeding the length limit.'
Enabled: pending
VersionAdded: <<next>>
VersionChanged: <<next>>

Rails/IndexWith:
Description: 'Prefer `index_with` over `each_with_object`, `to_h`, or `map`.'
Enabled: true
Expand Down
1 change: 1 addition & 0 deletions docs/modules/ROOT/pages/cops.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ based on the https://rails.rubystyle.guide/[Rails Style Guide].
* xref:cops_rails.adoc#railsignoredcolumnsassignment[Rails/IgnoredColumnsAssignment]
* xref:cops_rails.adoc#railsignoredskipactionfilteroption[Rails/IgnoredSkipActionFilterOption]
* xref:cops_rails.adoc#railsindexby[Rails/IndexBy]
* xref:cops_rails.adoc#railsindexnames[Rails/IndexNames]
* xref:cops_rails.adoc#railsindexwith[Rails/IndexWith]
* xref:cops_rails.adoc#railsinquiry[Rails/Inquiry]
* xref:cops_rails.adoc#railsinverseof[Rails/InverseOf]
Expand Down
Loading

0 comments on commit a8447fc

Please sign in to comment.