Skip to content

Commit

Permalink
Update rubocop gem and configuration (#4100)
Browse files Browse the repository at this point in the history
* Update rubocop-rails and rubocop

* Update rubocop_todo file with latest rubocop v0.81

* Add defaults to `rubocop.yml` for new v0.80 and v0.81 cops

There are a few new cops in this diff that *require* a setting in
`rubocop.yml`. We missed it in v0.80 and now they're included and
defaulted to `false` to get us in sync for v0.81 in this PR.
  • Loading branch information
johnpaulashenfelter authored Apr 6, 2020
1 parent 6dccd9b commit 1868fca
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 30 deletions.
15 changes: 15 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -329,3 +329,18 @@ RSpec/SubjectStub:
# the default style recently changed, but it's not worth changing
Rails/FilePath:
EnforcedStyle: arguments

Lint/RaiseException:
Enabled: false

Lint/StructNewOverride:
Enabled: false

Style/HashEachMethods:
Enabled: false

Style/HashTransformKeys:
Enabled: false

Style/HashTransformValues:
Enabled: false
48 changes: 23 additions & 25 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2020-01-16 15:49:25 -0500 using RuboCop version 0.79.0.
# on 2020-04-03 14:24:58 -0400 using RuboCop version 0.81.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 126
# Offense count: 149
# Cop supports --auto-correct.
FactoryBot/FactoryClassName:
Enabled: false

# Offense count: 31
# Offense count: 1
# Cop supports --auto-correct.
Layout/EmptyLineAfterGuardClause:
Exclude:
- 'lib/common/models/collection.rb'

# Offense count: 28
# Cop supports --auto-correct.
RSpec/ContextMethod:
Exclude:
Expand All @@ -27,35 +33,27 @@ RSpec/ContextMethod:
- 'spec/models/mhv_account_spec.rb'
- 'spec/request/address_request_spec.rb'
- 'spec/request/evss_claims_async_spec.rb'
- 'spec/routing/address_routing.rb'
- 'spec/services/users/profile_spec.rb'

# Offense count: 69
# Offense count: 66
# Cop supports --auto-correct.
# Configuration parameters: AllowConsecutiveOneLiners.
RSpec/EmptyLineAfterExample:
Enabled: false

# Offense count: 14
RSpec/SubjectStub:
# Offense count: 8
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/UniqueValidationWithoutIndex:
Exclude:
- 'spec/jobs/education_form/create_daily_spool_files_spec.rb'
- 'spec/jobs/education_form/forms/va1990_spec.rb'
- 'spec/jobs/transactional_email_analytics_job_spec.rb'
- 'spec/lib/bb/generate_report_request_form_spec.rb'
- 'spec/lib/common/models/redis_store_spec.rb'
- 'spec/lib/evss/disability_compensation_form/data_translation_all_claim_spec.rb'
- 'spec/lib/evss/disability_compensation_form/data_translation_spec.rb'
- 'spec/lib/saml/health_status_spec.rb'
- 'spec/lib/sm/client/folders_spec.rb'
- 'spec/models/emis_redis/military_information_spec.rb'
- 'spec/models/emis_redis/military_information_v2_spec.rb'
- 'spec/models/session_spec.rb'
- 'spec/services/evss_claim_service_spec.rb'
- 'spec/services/mhv_accounts_service_spec.rb'
- 'spec/uploaders/evss_claim_document_uploader_spec.rb'
- 'modules/vaos/spec/services/user_service_spec.rb'
- 'spec/lib/mvi/service_spec.rb'
- 'app/models/gibs_not_found_user.rb'
- 'app/models/invalid_letter_address_edipi.rb'
- 'app/models/preference_choice.rb'
- 'app/models/terms_and_conditions_acceptance.rb'
- 'app/models/user_preference.rb'
- 'modules/claims_api/app/models/claims_api/auto_established_claim.rb'
- 'modules/claims_api/app/models/claims_api/power_of_attorney.rb'
- 'modules/va_forms/app/models/va_forms/form.rb'

# Offense count: 7
ThreadSafety/ClassAndModuleAttributes:
Expand All @@ -68,7 +66,7 @@ ThreadSafety/ClassAndModuleAttributes:
- 'lib/facilities/vha_facility.rb'
- 'lib/saml/health_status.rb'

# Offense count: 42
# Offense count: 43
ThreadSafety/InstanceVariableInClassMethod:
Exclude:
- 'app/models/base_facility.rb'
Expand Down
11 changes: 6 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ GEM
activerecord (>= 4.2)
request_store (~> 1.1)
parallel (1.19.1)
parser (2.7.0.3)
parser (2.7.0.5)
ast (~> 2.4.0)
pdf-core (0.7.0)
pdf-forms (1.2.0)
Expand Down Expand Up @@ -617,16 +617,17 @@ GEM
rspec-support (3.9.2)
rspec_junit_formatter (0.4.1)
rspec-core (>= 2, < 4, != 2.12.0)
rubocop (0.80.1)
rubocop (0.81.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.7.0.1)
rainbow (>= 2.2.2, < 4.0)
rexml
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.7)
unicode-display_width (>= 1.4.0, < 2.0)
rubocop-junit-formatter (0.1.4)
rubocop-rails (2.4.2)
rubocop-rails (2.5.1)
activesupport
rack (>= 1.1)
rubocop (>= 0.72.0)
rubocop-rspec (1.37.1)
Expand Down Expand Up @@ -717,7 +718,7 @@ GEM
ethon (>= 0.9.0)
tzinfo (1.2.6)
thread_safe (~> 0.1)
unicode-display_width (1.6.1)
unicode-display_width (1.7.0)
upsert (2.9.10)
uri_template (0.7.0)
utf8-cleaner (0.2.5)
Expand Down

0 comments on commit 1868fca

Please sign in to comment.