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

Enable support for cops introduced by 0.85 #68

Merged
merged 6 commits into from Jul 8, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


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

2.15.0
------
* Support new cop introduced by rubocop v0.87: `Style/AccessorGrouping`, `Style/BisectedAttrAccessor`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we feel about Style/AccessorGrouping? It groups blocks of attr_reader/writer together (see https://docs.rubocop.org/rubocop/cops_style.html#styleaccessorgrouping), but in cases where we've got a lot of them it may be better to split them logically

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's an element of personal style that I'd rather avoid forcing, e.g. this should be fine:

class Foo
  attr_reader :public_attr

  private

  attr_reader :private_attr
end

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't feel strongly here myself; if this would cause lots of churn for us then it's probably not worth it. If it only affects a few places then might be worth turning it on.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright I think I'll disable it for now, tried it in PS and I'm not convinced the proposed changes would make it any better

and `Style/RedundantAssignment`
* Support new cop introduced by rubocop v0.86: `Style/RedundantFetchBlock`
* Support new cops introduced by rubocop v0.85: `Lint/MixedRegexpCaptureTypes`, `Style/RedundantRegexpEscape`
and `Style/RedundantRegexpCharacterClass`

2.14.0
------
* Enable a new cop introduced by rubocop v0.84: `Lint/DeprecatedOpenSSLConstant`
Expand Down
4 changes: 2 additions & 2 deletions gc_ruboconfig.gemspec
Expand Up @@ -2,15 +2,15 @@

Gem::Specification.new do |spec|
spec.name = 'gc_ruboconfig'
spec.version = '2.14.0'
spec.version = '2.15.0'
spec.summary = "GoCardless's shared Rubocop configuration, conforming to our house style"
spec.authors = %w[GoCardless]
spec.homepage = 'https://github.com/gocardless/ruboconfig'
spec.email = %w[developers@gocardless.com]
spec.license = 'MIT'

spec.files = 'rubocop.yml'
spec.add_dependency 'rubocop', '>= 0.84'
spec.add_dependency 'rubocop', '>= 0.85'
ivgiuliani marked this conversation as resolved.
Show resolved Hide resolved
spec.add_dependency 'rubocop-rspec', '>= 1.38.1'
spec.add_dependency 'rubocop-performance', '~> 1.5'
end
21 changes: 21 additions & 0 deletions rubocop.yml
Expand Up @@ -24,6 +24,9 @@ Lint/RaiseException:
Lint/StructNewOverride:
Enabled: true

Lint/MixedRegexpCaptureTypes:
Enabled: true

Metrics/ClassLength:
Enabled: false

Expand Down Expand Up @@ -171,5 +174,23 @@ Style/ExponentialNotation:
Style/SlicingWithRange:
Enabled: true

Style/RedundantRegexpCharacterClass:
Enabled: true

Style/RedundantRegexpEscape:
ivgiuliani marked this conversation as resolved.
Show resolved Hide resolved
Enabled: true

Style/RedundantFetchBlock:
Enabled: true

Style/AccessorGrouping:
Enabled: true

Style/BisectedAttrAccessor:
Enabled: true

Style/RedundantAssignment:
Enabled: true

Lint/DeprecatedOpenSSLConstant:
Enabled: true