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

Update RuboCop to 1.5.0 #117

Merged
merged 1 commit into from
Dec 1, 2020
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions config/chefstyle.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
AllCops:
TargetRubyVersion: 2.4
SuggestExtensions: false

#
# Bundler
Expand Down
2 changes: 2 additions & 0 deletions config/disable_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,8 @@ Lint/TrailingCommaInAttributeDeclaration:
Enabled: false
Lint/UnderscorePrefixedVariableName:
Enabled: false
Lint/UnexpectedBlockArity:
Enabled: false
Lint/UnifiedInteger:
Enabled: false
Lint/UnmodifiedReduceAccumulator:
Expand Down
54 changes: 47 additions & 7 deletions config/upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,16 @@ AllCops:
# from the lock file.) If the Ruby version is still unresolved, RuboCop will
# use the oldest officially supported Ruby version (currently Ruby 2.4).
TargetRubyVersion: ~
# Determines if a notification for extension libraries should be shown when
# rubocop is run. Keys are the name of the extension, and values are an array
# of gems in the Gemfile that the extension is suggested for, if not already
# included.
SuggestExtensions:
rubocop-rails: [rails]
rubocop-rspec: [rspec, rspec-rails]
rubocop-minitest: [minitest]
rubocop-sequel: [sequel]
rubocop-rake: [rake]

#################### Bundler ###############################

Expand Down Expand Up @@ -1998,6 +2008,23 @@ Lint/UnderscorePrefixedVariableName:
VersionAdded: '0.21'
AllowKeywordBlockArguments: false

Lint/UnexpectedBlockArity:
Description: 'Looks for blocks that have fewer arguments that the calling method expects.'
Enabled: pending
Safe: false
VersionAdded: '1.5'
Methods:
chunk_while: 2
each_with_index: 2
each_with_object: 2
inject: 2
max: 2
min: 2
minmax: 2
reduce: 2
slice_when: 2
sort: 2

Lint/UnifiedInteger:
Description: 'Use Integer instead of Fixnum or Bignum.'
Enabled: true
Expand All @@ -2007,6 +2034,7 @@ Lint/UnmodifiedReduceAccumulator:
Description: Checks for `reduce` or `inject` blocks that do not update the accumulator each iteration.
Enabled: pending
VersionAdded: '1.1'
VersionChanged: '1.5'

Lint/UnreachableCode:
Description: 'Unreachable code.'
Expand Down Expand Up @@ -2110,21 +2138,23 @@ Metrics/AbcSize:
- https://en.wikipedia.org/wiki/ABC_Software_Metric
Enabled: true
VersionAdded: '0.27'
VersionChanged: '0.81'
VersionChanged: '1.5'
# The ABC size is a calculated magnitude, so this number can be an Integer or
# a Float.
IgnoredMethods: []
CountRepeatedAttributes: true
Max: 17

Metrics/BlockLength:
Description: 'Avoid long blocks with many lines.'
Enabled: true
VersionAdded: '0.44'
VersionChanged: '0.87'
VersionChanged: '1.5'
CountComments: false # count full line comments?
Max: 25
CountAsOne: []
ExcludedMethods:
ExcludedMethods: [] # deprecated, retained for backwards compatibility
IgnoredMethods:
# By default, exclude the `#refine` method, as it tends to have larger
# associated blocks.
- refine
Expand Down Expand Up @@ -2165,11 +2195,12 @@ Metrics/MethodLength:
StyleGuide: '#short-methods'
Enabled: true
VersionAdded: '0.25'
VersionChanged: '0.87'
VersionChanged: '1.5'
CountComments: false # count full line comments?
Max: 10
CountAsOne: []
ExcludedMethods: []
ExcludedMethods: [] # deprecated, retained for backwards compatibility
IgnoredMethods: []

Metrics/ModuleLength:
Description: 'Avoid modules longer than 100 lines of code.'
Expand All @@ -2185,8 +2216,10 @@ Metrics/ParameterLists:
StyleGuide: '#too-many-params'
Enabled: true
VersionAdded: '0.25'
VersionChanged: '1.5'
Max: 5
CountKeywordArgs: true
MaxOptionalParameters: 3

Metrics/PerceivedComplexity:
Description: >-
Expand Down Expand Up @@ -2464,7 +2497,13 @@ Naming/VariableNumber:
- non_integer
CheckMethodNames: true
CheckSymbols: true
AllowedIdentifiers: []
AllowedIdentifiers:
- capture3 # Open3.capture3
- iso8601 # Time#iso8601
- rfc1123_date # CGI.rfc1123_date
- rfc822 # Time#rfc822
- rfc2822 # Time#rfc2822
- rfc3339 # DateTime.rfc3339

#################### Security ##############################

Expand Down Expand Up @@ -4262,6 +4301,7 @@ Style/SoleNestedConditional:
which can be merged into outer conditional node.
Enabled: true
VersionAdded: '0.89'
VersionChanged: '1.5'
AllowModifier: false

Style/SpecialGlobalVars:
Expand Down Expand Up @@ -4394,7 +4434,7 @@ Style/SymbolProc:
Enabled: true
Safe: false
VersionAdded: '0.26'
VersionChanged: '0.64'
VersionChanged: '1.5'
# A list of method names to be ignored by the check.
# The names should be fairly unique, otherwise you'll end up ignoring lots of code.
IgnoredMethods:
Expand Down
2 changes: 1 addition & 1 deletion lib/chefstyle/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true
module Chefstyle
VERSION = "1.5.5"
RUBOCOP_VERSION = "1.4.2"
RUBOCOP_VERSION = "1.5.0"
end