bump rubocop version to 0.68.0 to support ruby 2.6
this changes upgrades to the earliest version of rubocop supporting ruby 2.6 while also choosing a version that fixes a breaking 0.60.0 change to revert psych version change. namespace changes were made on multiple cops to support the new rubocop version requirements as well as the change to move performance cops out of the rubocop gem in to rubocop-performance. the Layout/IndentFirstParameter cop is currently broken but a rubocop version upgrade will fix that. the FreezeConstants cop also required a fix to handle nil types. refs DE-289 test plan: - ensure rubocop runs completely Change-Id: I0ca68f426e287b5a973b96a4ae0e975f1cbc0240 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/248786 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> QA-Review: Kyle Rosenbaum <krosenbaum@instructure.com> Product-Review: Kyle Rosenbaum <krosenbaum@instructure.com> Reviewed-by: Ryan Norton <rnorton@instructure.com>
This commit is contained in:
parent
61527e8c47
commit
025556caf3
15
.rubocop.yml
15
.rubocop.yml
|
@ -1,5 +1,6 @@
|
|||
require:
|
||||
- rubocop-rspec
|
||||
- rubocop-performance
|
||||
# this odd relative path is so that rubocop works when run without "bundle
|
||||
# exec", such as from most editors/IDEs.
|
||||
- ./gems/rubocop-canvas/lib/rubocop_canvas
|
||||
|
@ -26,7 +27,7 @@ Layout/EmptyLinesAroundMethodBody:
|
|||
Enabled: false
|
||||
Layout/EmptyLinesAroundModuleBody:
|
||||
Enabled: false
|
||||
Layout/IndentHash:
|
||||
Layout/IndentFirstHashElement:
|
||||
Enabled: false
|
||||
Layout/IndentationConsistency:
|
||||
Enabled: false
|
||||
|
@ -93,7 +94,9 @@ Style/DoubleNegation:
|
|||
Enabled: false
|
||||
Style/TrailingCommaInArguments:
|
||||
Enabled: false
|
||||
Style/TrailingCommaInLiteral:
|
||||
Style/TrailingCommaInArrayLiteral:
|
||||
Enabled: false
|
||||
Style/TrailingCommaInHashLiteral:
|
||||
Enabled: false
|
||||
Style/MethodCallWithoutArgsParentheses:
|
||||
Enabled: false
|
||||
|
@ -194,7 +197,7 @@ Lint/UselessAssignment:
|
|||
Severity: convention
|
||||
Lint/Debugger:
|
||||
Severity: error
|
||||
Lint/EndAlignment:
|
||||
Layout/EndAlignment:
|
||||
EnforcedStyleAlignWith: variable
|
||||
Severity: convention
|
||||
|
||||
|
@ -212,7 +215,7 @@ Style/RescueModifier:
|
|||
Severity: warning
|
||||
Layout/MultilineMethodCallIndentation:
|
||||
EnforcedStyle: indented
|
||||
Layout/IndentArray:
|
||||
Layout/IndentFirstArrayElement:
|
||||
EnforcedStyle: consistent
|
||||
|
||||
# these don't make sense pre-Rails 4
|
||||
|
@ -278,3 +281,7 @@ Specs/EnsureSpecExtension:
|
|||
Enabled: true
|
||||
Exclude:
|
||||
- spec/shared_examples/**/*
|
||||
|
||||
# this cops is crashing; https://github.com/rubocop-hq/rubocop/issues/6992
|
||||
Layout/IndentFirstParameter:
|
||||
Enabled: false
|
||||
|
|
|
@ -2,7 +2,7 @@ inherit_from: ../.rubocop.yml
|
|||
|
||||
Metrics/LineLength:
|
||||
Enabled: false
|
||||
Style/IndentationConsistency:
|
||||
Layout/IndentationConsistency:
|
||||
Enabled: false
|
||||
Metrics/MethodLength:
|
||||
Enabled: false
|
||||
|
|
|
@ -38,9 +38,10 @@ group :test do
|
|||
gem 'shoulda-matchers', '4.3.0'
|
||||
|
||||
gem 'rubocop-canvas', require: false, path: 'gems/rubocop-canvas'
|
||||
gem 'rubocop', '0.52.1', require: false
|
||||
gem 'rubocop', '0.68.0', require: false
|
||||
gem 'rainbow', '3.0.0', require: false
|
||||
gem 'rubocop-rspec', '1.22.2', require: false
|
||||
gem 'rubocop-rspec', '1.33.0', require: false
|
||||
gem 'rubocop-performance', '1.3.0', require: false
|
||||
|
||||
gem 'once-ler', '0.1.4'
|
||||
gem 'sauce_whisk', '0.2.2'
|
||||
|
|
|
@ -2,7 +2,7 @@ inherit_from: ../../.rubocop.yml
|
|||
|
||||
Metrics/LineLength:
|
||||
Enabled: false
|
||||
Style/IndentationConsistency:
|
||||
Layout/IndentationConsistency:
|
||||
Enabled: false
|
||||
Metrics/MethodLength:
|
||||
Enabled: false
|
||||
|
|
|
@ -47,7 +47,7 @@ module RuboCop
|
|||
|
||||
def target_isnt_structure_or_string(node)
|
||||
target = node.children.first
|
||||
![:hash, :array, :string].include?(target.type)
|
||||
![:hash, :array, :string].include?(target&.type)
|
||||
end
|
||||
|
||||
def check_children(node, safe_at_next_level)
|
||||
|
|
|
@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
|
|||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_runtime_dependency "rubocop", "~> 0.52.0"
|
||||
spec.add_runtime_dependency "rubocop", "~> 0.68.0"
|
||||
spec.add_runtime_dependency "jira_ref_parser", "1.0.1"
|
||||
spec.add_development_dependency "bundler", "~> 1.7"
|
||||
spec.add_development_dependency "pry", "~> 0.10.1"
|
||||
|
|
Loading…
Reference in New Issue