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.3.0 #112

Merged
merged 2 commits into from
Nov 12, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ end
group :development do
gem "rake", ">= 12.0"
gem "rspec", ">= 3.4"
end
end

# pin until we drop ruby 2.4 and then remove this entirely
gem "parallel", "< 1.20"
8 changes: 8 additions & 0 deletions config/disable_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ Lint/DeprecatedOpenSSLConstant:
Enabled: false
Lint/DisjunctiveAssignmentInConstructor:
Enabled: false
Lint/DuplicateBranch:
Enabled: false
Lint/DuplicateCaseCondition:
Enabled: false
Lint/DuplicateElsifCondition:
Expand All @@ -249,6 +251,8 @@ Lint/ElseLayout:
Enabled: false
Lint/EmptyBlock:
Enabled: false
Lint/EmptyClass:
Enabled: false
Lint/EmptyConditionalBody:
Enabled: false
Lint/EmptyEnsure:
Expand Down Expand Up @@ -657,6 +661,8 @@ Style/RedundantSelfAssignment:
Enabled: false
Style/SoleNestedConditional:
Enabled: false
Style/StaticClass:
Enabled: false
Style/MethodCalledOnDoEndBlock:
Enabled: false
Style/MethodDefParentheses:
Expand Down Expand Up @@ -709,6 +715,8 @@ Style/Next:
Enabled: false
Style/NilComparison:
Enabled: false
Style/NilLambda:
Enabled: false
Style/NonNilCheck:
Enabled: false
Style/Not:
Expand Down
66 changes: 59 additions & 7 deletions config/upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ Layout/LineLength:
StyleGuide: '#max-line-length'
Enabled: true
VersionAdded: '0.25'
VersionChanged: '0.84'
VersionChanged: '1.3'
AutoCorrect: false
Max: 120
# To make it possible to copy or click on URIs in the code, we allow lines
Expand Down Expand Up @@ -1400,6 +1400,8 @@ Lint/ConstantDefinitionInBlock:
StyleGuide: '#no-constant-definition-in-block'
Enabled: true
VersionAdded: '0.91'
VersionChanged: '1.3'
AllowedMethods: []

Lint/ConstantResolution:
Description: 'Check that constants are fully qualified with `::`.'
Expand All @@ -1415,6 +1417,22 @@ Lint/Debugger:
Enabled: true
VersionAdded: '0.14'
VersionChanged: '0.49'
DebuggerReceivers:
- binding
- Kernel
- Pry
DebuggerMethods:
- debugger
- byebug
- remote_byebug
- pry
- remote_pry
- pry_remote
- console
- rescue
- save_and_open_page
- save_and_open_screenshot
- irb

Lint/DeprecatedClassMethods:
Description: 'Check for deprecated class method calls.'
Expand All @@ -1433,6 +1451,11 @@ Lint/DisjunctiveAssignmentInConstructor:
VersionAdded: '0.62'
VersionChanged: '0.88'

Lint/DuplicateBranch:
Description: Checks that there are no repeated bodies within `if/unless`, `case-when` and `rescue` constructs.
Enabled: pending
VersionAdded: '1.3'

Lint/DuplicateCaseCondition:
Description: 'Do not repeat values in case conditionals.'
Enabled: true
Expand Down Expand Up @@ -1484,7 +1507,15 @@ Lint/EmptyBlock:
Description: 'This cop checks for blocks without a body.'
Enabled: pending
VersionAdded: '1.1'
VersionChanged: '1.3'
AllowComments: true
AllowEmptyLambdas: true

Lint/EmptyClass:
Description: 'Checks for classes and metaclasses without a body.'
Enabled: pending
VersionAdded: '1.3'
AllowComments: false

Lint/EmptyConditionalBody:
Description: 'This cop checks for the presence of `if`, `elsif` and `unless` branches without a body.'
Expand Down Expand Up @@ -1628,7 +1659,8 @@ Lint/Loop:
StyleGuide: '#loop-with-break'
Enabled: true
VersionAdded: '0.9'
VersionChanged: '0.89'
VersionChanged: '1.3'
Safe: false

Lint/MissingCopEnableDirective:
Description: 'Checks for a `# rubocop:enable` after `# rubocop:disable`.'
Expand Down Expand Up @@ -2416,14 +2448,15 @@ Naming/VariableNumber:
StyleGuide: '#snake-case-symbols-methods-vars-with-numbers'
Enabled: true
VersionAdded: '0.50'
VersionChanged: '1.2'
VersionChanged: '1.3'
EnforcedStyle: normalcase
SupportedStyles:
- snake_case
- normalcase
- non_integer
CheckMethodNames: true
CheckSymbols: true
AllowedIdentifiers: []

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

Expand Down Expand Up @@ -2805,7 +2838,9 @@ Style/ClassVars:
Style/CollectionCompact:
Description: 'Use `{Array,Hash}#{compact,compact!}` instead of custom logic to reject nils.'
Enabled: pending
Safe: false
VersionAdded: '1.2'
VersionChanged: '1.3'

# Align with the style guide.
Style/CollectionMethods:
Expand Down Expand Up @@ -2870,17 +2905,18 @@ Style/CommandLiteral:
Style/CommentAnnotation:
Description: >-
Checks formatting of special comments
(TODO, FIXME, OPTIMIZE, HACK, REVIEW).
(TODO, FIXME, OPTIMIZE, HACK, REVIEW, NOTE).
StyleGuide: '#annotate-keywords'
Enabled: true
VersionAdded: '0.10'
VersionChanged: '0.31'
VersionChanged: '1.3'
Keywords:
- TODO
- FIXME
- OPTIMIZE
- HACK
- REVIEW
- NOTE

Style/CommentedKeyword:
Description: 'Do not place comments on the same line as certain keywords.'
Expand Down Expand Up @@ -2976,6 +3012,7 @@ Style/DocumentDynamicEvalDefinition:
StyleGuide: '#eval-comment-docs'
Enabled: pending
VersionAdded: '1.1'
VersionChanged: '1.3'

Style/Documentation:
Description: 'Document classes and non-namespace modules.'
Expand Down Expand Up @@ -3303,6 +3340,7 @@ Style/IfInsideElse:
Enabled: true
AllowIfModifier: false
VersionAdded: '0.36'
VersionChanged: '1.3'

Style/IfUnlessModifier:
Description: >-
Expand Down Expand Up @@ -3335,12 +3373,14 @@ Style/ImplicitRuntimeError:
VersionAdded: '0.41'

Style/InfiniteLoop:
Description: 'Use Kernel#loop for infinite loops.'
Description: >-
Use Kernel#loop for infinite loops.
This cop is unsafe in the body may raise a `StopIteration` exception.
Safe: false
StyleGuide: '#infinite-loop'
Enabled: true
VersionAdded: '0.26'
VersionChanged: '0.61'
SafeAutoCorrect: true

Style/InlineComment:
Description: 'Avoid trailing inline comments.'
Expand Down Expand Up @@ -3723,6 +3763,11 @@ Style/NilComparison:
- predicate
- comparison

Style/NilLambda:
Description: 'Prefer `-> {}` to `-> { nil }`.'
Enabled: pending
VersionAdded: '1.3'

Style/NonNilCheck:
Description: 'Checks for redundant nil checks.'
StyleGuide: '#no-non-nil-checks'
Expand Down Expand Up @@ -4222,6 +4267,13 @@ Style/StabbyLambdaParentheses:
- require_parentheses
- require_no_parentheses

Style/StaticClass:
Description: 'Prefer modules to classes with only class methods.'
StyleGuide: '#modules-vs-classes'
Enabled: false
Safe: false
VersionAdded: '1.3'

Style/StderrPuts:
Description: 'Use `warn` instead of `$stderr.puts`.'
StyleGuide: '#warn'
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.0"
RUBOCOP_VERSION = "1.2.0"
RUBOCOP_VERSION = "1.3.0"
end