diff --git a/Gemfile b/Gemfile index aed4cdc..afa7ab6 100644 --- a/Gemfile +++ b/Gemfile @@ -13,4 +13,7 @@ end group :development do gem "rake", ">= 12.0" gem "rspec", ">= 3.4" -end \ No newline at end of file +end + +# pin until we drop ruby 2.4 and then remove this entirely +gem "parallel", "< 1.20" \ No newline at end of file diff --git a/config/disable_all.yml b/config/disable_all.yml index dd4e59f..f8fe3a0 100644 --- a/config/disable_all.yml +++ b/config/disable_all.yml @@ -229,6 +229,8 @@ Lint/DeprecatedOpenSSLConstant: Enabled: false Lint/DisjunctiveAssignmentInConstructor: Enabled: false +Lint/DuplicateBranch: + Enabled: false Lint/DuplicateCaseCondition: Enabled: false Lint/DuplicateElsifCondition: @@ -249,6 +251,8 @@ Lint/ElseLayout: Enabled: false Lint/EmptyBlock: Enabled: false +Lint/EmptyClass: + Enabled: false Lint/EmptyConditionalBody: Enabled: false Lint/EmptyEnsure: @@ -657,6 +661,8 @@ Style/RedundantSelfAssignment: Enabled: false Style/SoleNestedConditional: Enabled: false +Style/StaticClass: + Enabled: false Style/MethodCalledOnDoEndBlock: Enabled: false Style/MethodDefParentheses: @@ -709,6 +715,8 @@ Style/Next: Enabled: false Style/NilComparison: Enabled: false +Style/NilLambda: + Enabled: false Style/NonNilCheck: Enabled: false Style/Not: diff --git a/config/upstream.yml b/config/upstream.yml index c539d31..df644d2 100644 --- a/config/upstream.yml +++ b/config/upstream.yml @@ -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 @@ -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 `::`.' @@ -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.' @@ -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 @@ -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.' @@ -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`.' @@ -2416,7 +2448,7 @@ 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 @@ -2424,6 +2456,7 @@ Naming/VariableNumber: - non_integer CheckMethodNames: true CheckSymbols: true + AllowedIdentifiers: [] #################### Security ############################## @@ -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: @@ -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.' @@ -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.' @@ -3303,6 +3340,7 @@ Style/IfInsideElse: Enabled: true AllowIfModifier: false VersionAdded: '0.36' + VersionChanged: '1.3' Style/IfUnlessModifier: Description: >- @@ -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.' @@ -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' @@ -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' diff --git a/lib/chefstyle/version.rb b/lib/chefstyle/version.rb index d5d0bf0..608c666 100644 --- a/lib/chefstyle/version.rb +++ b/lib/chefstyle/version.rb @@ -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 \ No newline at end of file