Skip to content

Commit

Permalink
Upgrade Rubocop
Browse files Browse the repository at this point in the history
Since version ~0.80, rubocop now warns you about new rules and you have to explicitly enable or disable them. 

I reviewed each of these rules and decided to keep them, primarily because I either liked what the rule did or it was trivial, autocorrectable, and I trust the rubocop/rails community. I’m open to changing any of the rules if they prove problematic. 

Docs: https://docs.rubocop.org/rubocop/0.85/versioning.html#pending-cops

I tried upgrading to the latest version (0.86), but that resulted in some gem version conflicts that would’ve required upgrading capyabara, which I already decided I don’t want to deal with yet: charitywater/maji@dd9d67e

BracesAroundHashParameters was removed: rubocop/rubocop#7641

[#172410772]
  • Loading branch information
jasdeepgosal committed Jun 24, 2020
1 parent 73d0f6d commit 89f2c0d
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cw-style.gemspec
Expand Up @@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

spec.add_dependency "rubocop", ">= 0.74.0"
spec.add_dependency "rubocop", ">= 0.84.0"
spec.add_dependency "rubocop-rspec-focused", "= 0.0.3"
spec.add_dependency "rubocop-thread_safety"
spec.add_dependency "rubocop-rails"
Expand Down
35 changes: 31 additions & 4 deletions default.yml
Expand Up @@ -21,6 +21,36 @@ Layout/CaseIndentation:
Layout/MultilineMethodCallBraceLayout:
Enabled: false

Layout/EmptyLinesAroundAttributeAccessor:
Enabled: true

Layout/SpaceAroundMethodCallOperator:
Enabled: true

Lint/DeprecatedOpenSSLConstant:
Enabled: true

Lint/RaiseException:
Enabled: true

Lint/StructNewOverride:
Enabled: true

Style/ExponentialNotation:
Enabled: true

Style/HashEachMethods:
Enabled: true

Style/HashTransformKeys:
Enabled: true

Style/HashTransformValues:
Enabled: true

Style/SlicingWithRange:
Enabled: true

Metrics/AbcSize:
Enabled: false

Expand All @@ -42,7 +72,7 @@ Metrics/ParameterLists:
Metrics/PerceivedComplexity:
Enabled: false

Metrics/LineLength:
Layout/LineLength:
Enabled: false

Rails:
Expand All @@ -64,9 +94,6 @@ Rails/TimeZone:
RSpec/Focused:
Enabled: true

Style/BracesAroundHashParameters:
Enabled: false

Style/Documentation:
Enabled: false

Expand Down
2 changes: 1 addition & 1 deletion lib/charity_water/style/version.rb
@@ -1,5 +1,5 @@
module CharityWater
module Style
VERSION = '3.0.0'.freeze
VERSION = '4.0.0'.freeze
end
end

0 comments on commit 89f2c0d

Please sign in to comment.