Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include rubocop-rails #93

Merged
merged 2 commits into from
Feb 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Changelog
=========

2.33.0
-----
Adding `rubocop-rails` as part of the default install

* Enabled all `Rails/` cops except:
- `Rails/AddColumnIndex` - Allow `index: true` when creating a column
- `Rails/ShortI18n` - Use long form `translate` and `localize` instead of `t` and `l`

2.32.0
-----
Adding support for new cops:
Expand Down
18 changes: 0 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,3 @@ Next, just inherit from it in your `.rubocop.yml`:
inherit_gem:
gc_ruboconfig: rubocop.yml
```

## Note for Rails applications

If using `gc_ruboconfig` with a Rails application, you might wish to use `rubocop-rails`
as well.

In `Gemfile`:

```ruby
gem 'rubocop-rails'
```

In `.rubocop.yml`:

```yaml
require:
- rubocop-rails
```
3 changes: 2 additions & 1 deletion gc_ruboconfig.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Gem::Specification.new do |spec|
spec.name = 'gc_ruboconfig'
spec.version = '2.32.0'
spec.version = '2.33.0'
spec.summary = "GoCardless's shared Rubocop configuration, conforming to our house style"
spec.authors = %w[GoCardless]
spec.homepage = 'https://github.com/gocardless/ruboconfig'
Expand All @@ -12,5 +12,6 @@ Gem::Specification.new do |spec|
spec.files = 'rubocop.yml'
spec.add_dependency 'rubocop', '>= 1.25'
spec.add_dependency 'rubocop-performance', '>= 1.13'
spec.add_dependency 'rubocop-rails', '>= 2.13.0'
spec.add_dependency 'rubocop-rspec', '>= 2.8.0'
end
85 changes: 85 additions & 0 deletions rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require:
- rubocop-rspec
- rubocop-rails
- rubocop-performance

AllCops:
Expand Down Expand Up @@ -565,3 +566,87 @@ Performance/ConcurrentMonotonicTime:

Performance/StringIdentifierArgument:
Enabled: true

Rails/AddColumnIndex:
Enabled: false

Rails/CompactBlank:
Enabled: true

Rails/DurationArithmetic:
Enabled: true

Rails/EagerEvaluationLogMessage:
Enabled: true

Rails/ExpandedDateRange:
Enabled: true

Rails/I18nLocaleAssignment:
Enabled: true

Rails/RedundantPresenceValidationOnBelongsTo:
Enabled: true

Rails/RedundantTravelBack:
Enabled: true

Rails/RootJoinChain:
Enabled: true

Rails/TimeZoneAssignment:
Enabled: true

Rails/UnusedIgnoredColumns:
Enabled: true

Rails/ActiveRecordCallbacksOrder:
Enabled: true

Rails/AfterCommitOverride:
Enabled: true

Rails/AttributeDefaultBlockValue:
Enabled: true

Rails/FindById:
Enabled: true

Rails/Inquiry:
Enabled: true

Rails/MailerName:
Enabled: true

Rails/MatchRoute:
Enabled: true

Rails/NegateInclude:
Enabled: true

Rails/Pluck:
Enabled: true

Rails/PluckInWhere:
Enabled: true

Rails/RenderInline:
Enabled: true

Rails/RenderPlainText:
Enabled: true

Rails/ShortI18n:
Enabled: false

Rails/SquishedSQLHeredocs:
Enabled: true

Rails/WhereEquals:
Enabled: true

Rails/WhereExists:
Enabled: true

Rails/WhereNot:
Enabled: true