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

Upgrade to rubocop 1.x #57

Merged
merged 4 commits into from
Feb 23, 2022
Merged
Show file tree
Hide file tree
Changes from 3 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
26 changes: 9 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1

orbs:
samvera: samvera/circleci-orb@0
samvera: samvera/circleci-orb@1

jobs:
bundle_lint_test:
Expand All @@ -12,7 +12,7 @@ jobs:
type: string
bundler_version:
type: string
default: 1.17.3
default: 2.3.6

executor:
name: 'samvera/ruby'
Expand All @@ -21,35 +21,27 @@ jobs:
steps:
- samvera/cached_checkout

- samvera/bundle_for_gem:
- samvera/bundle:
ruby_version: << parameters.ruby_version >>
bundler_version: << parameters.bundler_version >>
project: << parameters.project >>
cache_version: '2'

- samvera/rubocop

workflows:
version: 2
ci:
jobs:
- bundle_lint_test:
project: bixby
name: ruby2-4
ruby_version: 2.4.10

- bundle_lint_test:
project: bixby
name: ruby2-5
ruby_version: 2.5.8

- bundle_lint_test:
project: bixby
name: ruby2-6
ruby_version: 2.6.6
ruby_version: 2.6.9

- bundle_lint_test:
project: bixby
name: ruby2-7
ruby_version: 2.7.1
ruby_version: 2.7.5

- bundle_lint_test:
project: bixby
name: ruby3-0
ruby_version: 3.0.3
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
inherit_from: bixby_default.yml
Copy link
Member Author

Choose a reason for hiding this comment

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

Eat our own dog food. 🐶

9 changes: 4 additions & 5 deletions bixby.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ Gem::Specification.new do |spec|
spec.version = '3.0.2'
spec.license = 'Apache-2.0'

spec.add_dependency 'rubocop', '0.85.1'
# Added to prevent downstream breakage; When we update the above
# Rubocop version, we will want to revisit this dependency. Either
# changing the version range OR removing it.
spec.add_dependency 'rubocop-ast', '~> 0.3.0'
spec.required_ruby_version = '>= 2.6'
Copy link
Member Author

Choose a reason for hiding this comment

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

Rubocop required setting this to match the TargetRubyVersion in the rubocop config.


spec.add_dependency 'rubocop', '>= 1', '< 2'
Copy link
Member Author

Choose a reason for hiding this comment

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

Should this use ~> instead?

Suggested change
spec.add_dependency 'rubocop', '>= 1', '< 2'
spec.add_dependency 'rubocop', '~> 1.0'

spec.add_dependency 'rubocop-ast'
spec.add_dependency 'rubocop-performance'
spec.add_dependency 'rubocop-rails'
spec.add_dependency 'rubocop-rspec'
Expand Down
4 changes: 2 additions & 2 deletions bixby_default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ Style/MethodCallWithoutArgsParentheses:
Style/MethodDefParentheses:
Enabled: true

Style/MethodMissingSuper:
Copy link
Member Author

Choose a reason for hiding this comment

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

This cop changed to Lint/MissingSuper

Style/MissingSuper:
cjcolvar marked this conversation as resolved.
Show resolved Hide resolved
Enabled: true

Style/MissingRespondToMissing:
Expand Down Expand Up @@ -795,7 +795,7 @@ Lint/UselessAccessModifier:
Lint/UselessAssignment:
Enabled: true

Lint/UselessComparison:
Lint/BinaryOperatorWithIdenticalOperands:
Copy link
Member Author

Choose a reason for hiding this comment

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

This cop's name changed.

Enabled: true

Lint/UselessElseWithoutRescue:
Expand Down
6 changes: 2 additions & 4 deletions bixby_rspec_enabled.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
require: rubocop-rspec

AllCops:
RSpec:
Patterns:
RSpec:
Include:
Comment on lines +4 to +5
Copy link
Member Author

Choose a reason for hiding this comment

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

rubocop-rspec moved and renamed this property.

- _spec.rb
- "(?:^|/)spec/"

Expand All @@ -25,7 +24,6 @@ RSpec/DescribeMethod:

RSpec/EmptyExampleGroup:
Enabled: true
CustomIncludeMethods: []
Copy link
Member Author

Choose a reason for hiding this comment

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

This property is no longer supported by this cop.


RSpec/ExampleLength:
Enabled: true
Expand Down