From: david22swan Date: Wed, 29 Mar 2023 09:22:40 +0000 (+0100) Subject: (CONT-799) Update Rubocop Versions X-Git-Tag: v5.0.0~1^2~1 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=0a42f177f65f9dc877f5e4388ddb3535b9e547d0;p=puppet-modules%2Fpuppetlabs-firewall.git (CONT-799) Update Rubocop Versions New Versions: rubocop = 1.48.1 rubocop-performance = 1.16.0 rubocop-rspec = 2.19.0 Also includes the reactivation of all previously disabled Cops --- diff --git a/.rubocop.yml b/.rubocop.yml index 31e8248..fec02db 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,10 +1,15 @@ --- +inherit_from: .rubocop_todo.yml + require: - rubocop-performance - rubocop-rspec AllCops: + NewCops: enable DisplayCopNames: true - TargetRubyVersion: '2.5' + ExtraDetails: true + DisplayStyleGuide: true + TargetRubyVersion: '2.7' Include: - "**/*.rb" Exclude: @@ -78,442 +83,4 @@ Style/Documentation: - lib/puppet/parser/functions/**/* - spec/**/* Style/WordArray: - EnforcedStyle: brackets -Performance/AncestorsInclude: - Enabled: true -Performance/BigDecimalWithNumericArgument: - Enabled: true -Performance/BlockGivenWithExplicitBlock: - Enabled: true -Performance/CaseWhenSplat: - Enabled: true -Performance/ConstantRegexp: - Enabled: true -Performance/MethodObjectAsBlock: - Enabled: true -Performance/RedundantSortBlock: - Enabled: true -Performance/RedundantStringChars: - Enabled: true -Performance/ReverseFirst: - Enabled: true -Performance/SortReverse: - Enabled: true -Performance/Squeeze: - Enabled: true -Performance/StringInclude: - Enabled: true -Performance/Sum: - Enabled: true -Style/CollectionMethods: - Enabled: true -Style/MethodCalledOnDoEndBlock: - Enabled: true -Style/StringMethods: - Enabled: true -Bundler/InsecureProtocolSource: - Enabled: false -Gemspec/DuplicatedAssignment: - Enabled: false -Gemspec/OrderedDependencies: - Enabled: false -Gemspec/RequiredRubyVersion: - Enabled: false -Gemspec/RubyVersionGlobalsUsage: - Enabled: false -Layout/ArgumentAlignment: - Enabled: false -Layout/BeginEndAlignment: - Enabled: false -Layout/ClosingHeredocIndentation: - Enabled: false -Layout/EmptyComment: - Enabled: false -Layout/EmptyLineAfterGuardClause: - Enabled: false -Layout/EmptyLinesAroundArguments: - Enabled: false -Layout/EmptyLinesAroundAttributeAccessor: - Enabled: false -Layout/EndOfLine: - Enabled: false -Layout/FirstArgumentIndentation: - Enabled: false -Layout/HashAlignment: - Enabled: false -Layout/HeredocIndentation: - Enabled: false -Layout/LeadingEmptyLines: - Enabled: false -Layout/SpaceAroundMethodCallOperator: - Enabled: false -Layout/SpaceInsideArrayLiteralBrackets: - Enabled: false -Layout/SpaceInsideReferenceBrackets: - Enabled: false -Lint/BigDecimalNew: - Enabled: false -Lint/BooleanSymbol: - Enabled: false -Lint/ConstantDefinitionInBlock: - Enabled: false -Lint/DeprecatedOpenSSLConstant: - Enabled: false -Lint/DisjunctiveAssignmentInConstructor: - Enabled: false -Lint/DuplicateElsifCondition: - Enabled: false -Lint/DuplicateRequire: - Enabled: false -Lint/DuplicateRescueException: - Enabled: false -Lint/EmptyConditionalBody: - Enabled: false -Lint/EmptyFile: - Enabled: false -Lint/ErbNewArguments: - Enabled: false -Lint/FloatComparison: - Enabled: false -Lint/HashCompareByIdentity: - Enabled: false -Lint/IdentityComparison: - Enabled: false -Lint/InterpolationCheck: - Enabled: false -Lint/MissingCopEnableDirective: - Enabled: false -Lint/MixedRegexpCaptureTypes: - Enabled: false -Lint/NestedPercentLiteral: - Enabled: false -Lint/NonDeterministicRequireOrder: - Enabled: false -Lint/OrderedMagicComments: - Enabled: false -Lint/OutOfRangeRegexpRef: - Enabled: false -Lint/RaiseException: - Enabled: false -Lint/RedundantCopEnableDirective: - Enabled: false -Lint/RedundantRequireStatement: - Enabled: false -Lint/RedundantSafeNavigation: - Enabled: false -Lint/RedundantWithIndex: - Enabled: false -Lint/RedundantWithObject: - Enabled: false -Lint/RegexpAsCondition: - Enabled: false -Lint/ReturnInVoidContext: - Enabled: false -Lint/SafeNavigationConsistency: - Enabled: false -Lint/SafeNavigationWithEmpty: - Enabled: false -Lint/SelfAssignment: - Enabled: false -Lint/SendWithMixinArgument: - Enabled: false -Lint/ShadowedArgument: - Enabled: false -Lint/StructNewOverride: - Enabled: false -Lint/ToJSON: - Enabled: false -Lint/TopLevelReturnWithArgument: - Enabled: false -Lint/TrailingCommaInAttributeDeclaration: - Enabled: false -Lint/UnreachableLoop: - Enabled: false -Lint/UriEscapeUnescape: - Enabled: false -Lint/UriRegexp: - Enabled: false -Lint/UselessMethodDefinition: - Enabled: false -Lint/UselessTimes: - Enabled: false -Metrics/AbcSize: - Enabled: false -Metrics/BlockLength: - Enabled: false -Metrics/BlockNesting: - Enabled: false -Metrics/ClassLength: - Enabled: false -Metrics/CyclomaticComplexity: - Enabled: false -Metrics/MethodLength: - Enabled: false -Metrics/ModuleLength: - Enabled: false -Metrics/ParameterLists: - Enabled: false -Metrics/PerceivedComplexity: - Enabled: false -Migration/DepartmentName: - Enabled: false -Naming/AccessorMethodName: - Enabled: false -Naming/BlockParameterName: - Enabled: false -Naming/HeredocDelimiterCase: - Enabled: false -Naming/HeredocDelimiterNaming: - Enabled: false -Naming/MemoizedInstanceVariableName: - Enabled: false -Naming/MethodParameterName: - Enabled: false -Naming/RescuedExceptionsVariableName: - Enabled: false -Naming/VariableNumber: - Enabled: false -Performance/BindCall: - Enabled: false -Performance/DeletePrefix: - Enabled: false -Performance/DeleteSuffix: - Enabled: false -Performance/InefficientHashSearch: - Enabled: false -Performance/UnfreezeString: - Enabled: false -Performance/UriDefaultParser: - Enabled: false -RSpec/Be: - Enabled: false -RSpec/Capybara/CurrentPathExpectation: - Enabled: false -RSpec/Capybara/FeatureMethods: - Enabled: false -RSpec/Capybara/VisibilityMatcher: - Enabled: false -RSpec/ContextMethod: - Enabled: false -RSpec/ContextWording: - Enabled: false -RSpec/DescribeClass: - Enabled: false -RSpec/EmptyHook: - Enabled: false -RSpec/EmptyLineAfterExample: - Enabled: false -RSpec/EmptyLineAfterExampleGroup: - Enabled: false -RSpec/EmptyLineAfterHook: - Enabled: false -RSpec/ExampleLength: - Enabled: false -RSpec/ExampleWithoutDescription: - Enabled: false -RSpec/ExpectChange: - Enabled: false -RSpec/ExpectInHook: - Enabled: false -RSpec/FactoryBot/AttributeDefinedStatically: - Enabled: false -RSpec/FactoryBot/CreateList: - Enabled: false -RSpec/FactoryBot/FactoryClassName: - Enabled: false -RSpec/HooksBeforeExamples: - Enabled: false -RSpec/ImplicitBlockExpectation: - Enabled: false -RSpec/ImplicitSubject: - Enabled: false -RSpec/LeakyConstantDeclaration: - Enabled: false -RSpec/LetBeforeExamples: - Enabled: false -RSpec/MissingExampleGroupArgument: - Enabled: false -RSpec/MultipleExpectations: - Enabled: false -RSpec/MultipleMemoizedHelpers: - Enabled: false -RSpec/MultipleSubjects: - Enabled: false -RSpec/NestedGroups: - Enabled: false -RSpec/PredicateMatcher: - Enabled: false -RSpec/ReceiveCounts: - Enabled: false -RSpec/ReceiveNever: - Enabled: false -RSpec/RepeatedExampleGroupBody: - Enabled: false -RSpec/RepeatedExampleGroupDescription: - Enabled: false -RSpec/RepeatedIncludeExample: - Enabled: false -RSpec/ReturnFromStub: - Enabled: false -RSpec/SharedExamples: - Enabled: false -RSpec/StubbedMock: - Enabled: false -RSpec/UnspecifiedException: - Enabled: false -RSpec/VariableDefinition: - Enabled: false -RSpec/VoidExpect: - Enabled: false -RSpec/Yield: - Enabled: false -Security/Open: - Enabled: false -Style/AccessModifierDeclarations: - Enabled: false -Style/AccessorGrouping: - Enabled: false -Style/AsciiComments: - Enabled: false -Style/BisectedAttrAccessor: - Enabled: false -Style/CaseLikeIf: - Enabled: false -Style/ClassEqualityComparison: - Enabled: false -Style/ColonMethodDefinition: - Enabled: false -Style/CombinableLoops: - Enabled: false -Style/CommentedKeyword: - Enabled: false -Style/Dir: - Enabled: false -Style/DoubleCopDisableDirective: - Enabled: false -Style/EmptyBlockParameter: - Enabled: false -Style/EmptyLambdaParameter: - Enabled: false -Style/Encoding: - Enabled: false -Style/EvalWithLocation: - Enabled: false -Style/ExpandPathArguments: - Enabled: false -Style/ExplicitBlockArgument: - Enabled: false -Style/ExponentialNotation: - Enabled: false -Style/FloatDivision: - Enabled: false -Style/FrozenStringLiteralComment: - Enabled: false -Style/GlobalStdStream: - Enabled: false -Style/HashAsLastArrayItem: - Enabled: false -Style/HashLikeCase: - Enabled: false -Style/HashTransformKeys: - Enabled: false -Style/HashTransformValues: - Enabled: false -Style/IfUnlessModifier: - Enabled: false -Style/KeywordParametersOrder: - Enabled: false -Style/MinMax: - Enabled: false -Style/MixinUsage: - Enabled: false -Style/MultilineWhenThen: - Enabled: false -Style/NegatedUnless: - Enabled: false -Style/NumericPredicate: - Enabled: false -Style/OptionalBooleanParameter: - Enabled: false -Style/OrAssignment: - Enabled: false -Style/RandomWithOffset: - Enabled: false -Style/RedundantAssignment: - Enabled: false -Style/RedundantCondition: - Enabled: false -Style/RedundantConditional: - Enabled: false -Style/RedundantFetchBlock: - Enabled: false -Style/RedundantFileExtensionInRequire: - Enabled: false -Style/RedundantRegexpCharacterClass: - Enabled: false -Style/RedundantRegexpEscape: - Enabled: false -Style/RedundantSelfAssignment: - Enabled: false -Style/RedundantSort: - Enabled: false -Style/RescueStandardError: - Enabled: false -Style/SingleArgumentDig: - Enabled: false -Style/SlicingWithRange: - Enabled: false -Style/SoleNestedConditional: - Enabled: false -Style/StderrPuts: - Enabled: false -Style/StringConcatenation: - Enabled: false -Style/Strip: - Enabled: false -Style/SymbolProc: - Enabled: false -Style/TrailingBodyOnClass: - Enabled: false -Style/TrailingBodyOnMethodDefinition: - Enabled: false -Style/TrailingBodyOnModule: - Enabled: false -Style/TrailingCommaInHashLiteral: - Enabled: false -Style/TrailingMethodEndStatement: - Enabled: false -Style/UnpackFirst: - Enabled: false -Lint/DuplicateBranch: - Enabled: false -Lint/DuplicateRegexpCharacterClassElement: - Enabled: false -Lint/EmptyBlock: - Enabled: false -Lint/EmptyClass: - Enabled: false -Lint/NoReturnInBeginEndBlocks: - Enabled: false -Lint/ToEnumArguments: - Enabled: false -Lint/UnexpectedBlockArity: - Enabled: false -Lint/UnmodifiedReduceAccumulator: - Enabled: false -Performance/CollectionLiteralInLoop: - Enabled: false -Style/ArgumentsForwarding: - Enabled: false -Style/CollectionCompact: - Enabled: false -Style/DocumentDynamicEvalDefinition: - Enabled: false -Style/NegatedIfElseCondition: - Enabled: false -Style/NilLambda: - Enabled: false -Style/RedundantArgument: - Enabled: false -Style/SwapValues: - Enabled: false + EnforcedStyle: brackets \ No newline at end of file diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml new file mode 100644 index 0000000..266218c --- /dev/null +++ b/.rubocop_todo.yml @@ -0,0 +1,510 @@ +# This configuration was generated by +# `rubocop --auto-gen-config` +# on 2023-03-29 09:22:12 UTC using RuboCop version 1.48.1. +# The point is for the user to remove these configuration records +# one by one as the offenses are removed from the code base. +# Note that changes in the inspected code, or installation of new +# versions of RuboCop, may require this file to be generated again. + +# Offense count: 13 +# This cop supports safe autocorrection (--autocorrect). +Layout/ClosingHeredocIndentation: + Exclude: + - 'spec/acceptance/firewall_attributes_exceptions_spec.rb' + - 'spec/acceptance/firewall_attributes_ipv6_exceptions_spec.rb' + - 'spec/acceptance/firewall_duplicate_comment_spec.rb' + - 'spec/spec_helper_acceptance_local.rb' + +# Offense count: 26 +# This cop supports safe autocorrection (--autocorrect). +Layout/EmptyLineAfterGuardClause: + Exclude: + - 'lib/puppet/provider/firewall/ip6tables.rb' + - 'lib/puppet/provider/firewall/iptables.rb' + - 'lib/puppet/provider/firewallchain/iptables_chain.rb' + - 'lib/puppet/type/firewall.rb' + - 'lib/puppet/util/firewall.rb' + - 'lib/puppet/util/ipcidr.rb' + +# Offense count: 3 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle. +# SupportedHashRocketStyles: key, separator, table +# SupportedColonStyles: key, separator, table +# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit +Layout/HashAlignment: + Exclude: + - 'spec/unit/puppet/type/firewall_spec.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Layout/HeredocIndentation: + Exclude: + - 'spec/unit/puppet/type/firewallchain_spec.rb' + +# Offense count: 3 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: leading, trailing +Layout/LineContinuationLeadingSpace: + Exclude: + - 'lib/puppet/type/firewallchain.rb' + +# Offense count: 7 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: aligned, indented +Layout/LineEndStringConcatenationIndentation: + Exclude: + - 'lib/puppet/provider/firewall/iptables.rb' + - 'lib/puppet/type/firewall.rb' + - 'lib/puppet/type/firewallchain.rb' + - 'spec/unit/puppet/type/firewall_spec.rb' + +# Offense count: 59 +# This cop supports unsafe autocorrection (--autocorrect-all). +Lint/BooleanSymbol: + Exclude: + - 'lib/puppet/provider/firewall/ip6tables.rb' + - 'lib/puppet/provider/firewall/iptables.rb' + - 'lib/puppet/type/firewall.rb' + - 'lib/puppet/type/firewallchain.rb' + +# Offense count: 4 +# Configuration parameters: AllowedMethods. +# AllowedMethods: enums +Lint/ConstantDefinitionInBlock: + Exclude: + - 'lib/puppet/provider/firewallchain/iptables_chain.rb' + +# Offense count: 6 +# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches. +Lint/DuplicateBranch: + Exclude: + - 'lib/puppet/provider/firewall/iptables.rb' + - 'lib/puppet/util/firewall.rb' + - 'spec/acceptance/firewall_attributes_exceptions_spec.rb' + - 'spec/unit/puppet/type/firewallchain_spec.rb' + +# Offense count: 1 +# Configuration parameters: AllowComments, AllowEmptyLambdas. +Lint/EmptyBlock: + Exclude: + - 'spec/unit/puppet/provider/ip6tables_spec.rb' + +# Offense count: 8 +# This cop supports safe autocorrection (--autocorrect). +Lint/RedundantCopEnableDirective: + Exclude: + - 'lib/puppet/provider/firewall/iptables.rb' + - 'spec/acceptance/firewall_attributes_exceptions_spec.rb' + - 'spec/unit/classes/firewall_spec.rb' + - 'spec/unit/puppet/type/firewall_spec.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AllowedMethods. +# AllowedMethods: instance_of?, kind_of?, is_a?, eql?, respond_to?, equal? +Lint/RedundantSafeNavigation: + Exclude: + - 'lib/puppet/provider/firewall/iptables.rb' + +# Offense count: 13 +# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes. +Metrics/AbcSize: + Max: 235 + +# Offense count: 23 +# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode. +# AllowedMethods: refine +Metrics/BlockLength: + Max: 1961 + +# Offense count: 2 +# Configuration parameters: CountBlocks. +Metrics/BlockNesting: + Max: 4 + +# Offense count: 8 +# Configuration parameters: AllowedMethods, AllowedPatterns. +Metrics/CyclomaticComplexity: + Max: 60 + +# Offense count: 19 +# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. +Metrics/MethodLength: + Max: 233 + +# Offense count: 1 +# Configuration parameters: CountComments, CountAsOne. +Metrics/ModuleLength: + Max: 193 + +# Offense count: 6 +# Configuration parameters: AllowedMethods, AllowedPatterns. +Metrics/PerceivedComplexity: + Max: 65 + +# Offense count: 1 +# Configuration parameters: EnforcedStyleForLeadingUnderscores. +# SupportedStylesForLeadingUnderscores: disallowed, required, optional +Naming/MemoizedInstanceVariableName: + Exclude: + - 'spec/spec_helper_acceptance_local.rb' + +# Offense count: 3 +# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. +# AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to +Naming/MethodParameterName: + Exclude: + - 'lib/puppet/type/firewall.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: PreferredName. +Naming/RescuedExceptionsVariableName: + Exclude: + - 'lib/puppet/util/firewall.rb' + +# Offense count: 12 +# Configuration parameters: MinSize. +Performance/CollectionLiteralInLoop: + Exclude: + - 'lib/puppet/provider/firewall/iptables.rb' + - 'spec/unit/puppet/type/firewall_spec.rb' + - 'spec/unit/puppet/type/firewallchain_spec.rb' + +# Offense count: 4 +# This cop supports safe autocorrection (--autocorrect). +Performance/StringIdentifierArgument: + Exclude: + - 'lib/puppet/provider/firewall/iptables.rb' + +# Offense count: 7 +# This cop supports unsafe autocorrection (--autocorrect-all). +Performance/StringInclude: + Exclude: + - 'lib/puppet/provider/firewall/iptables.rb' + - 'lib/puppet/type/firewall.rb' + - 'lib/puppet/util/ipcidr.rb' + +# Offense count: 15 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: be, be_nil +RSpec/BeNil: + Exclude: + - 'spec/unit/puppet/type/firewall_spec.rb' + - 'spec/unit/puppet/util/firewall_spec.rb' + +# Offense count: 7 +# Configuration parameters: Prefixes, AllowedPatterns. +# Prefixes: when, with, without +RSpec/ContextWording: + Exclude: + - 'spec/acceptance/firewall_attributes_exceptions_spec.rb' + - 'spec/unit/classes/firewall_linux_redhat_spec.rb' + - 'spec/unit/classes/firewall_linux_spec.rb' + +# Offense count: 25 +# Configuration parameters: IgnoredMetadata. +RSpec/DescribeClass: + Enabled: false + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +RSpec/EmptyHook: + Exclude: + - 'spec/unit/puppet/provider/ip6tables_spec.rb' + +# Offense count: 153 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowConsecutiveOneLiners. +RSpec/EmptyLineAfterExample: + Exclude: + - 'spec/acceptance/firewall_attributes_exceptions_spec.rb' + - 'spec/acceptance/firewall_attributes_happy_path_spec.rb' + - 'spec/acceptance/firewall_attributes_ipv6_exceptions_spec.rb' + - 'spec/acceptance/firewall_attributes_ipv6_happy_path_spec.rb' + - 'spec/acceptance/rules_spec.rb' + - 'spec/unit/classes/firewall_linux_archlinux_spec.rb' + - 'spec/unit/classes/firewall_linux_debian_spec.rb' + - 'spec/unit/classes/firewall_linux_redhat_spec.rb' + - 'spec/unit/puppet/provider/iptables_spec.rb' + - 'spec/unit/puppet/type/firewall_spec.rb' + - 'spec/unit/puppet/type/firewallchain_spec.rb' + - 'spec/unit/puppet/util/firewall_spec.rb' + +# Offense count: 16 +# This cop supports safe autocorrection (--autocorrect). +RSpec/EmptyLineAfterExampleGroup: + Exclude: + - 'spec/acceptance/firewall_attributes_exceptions_spec.rb' + - 'spec/acceptance/firewall_attributes_ipv6_exceptions_spec.rb' + - 'spec/unit/classes/firewall_spec.rb' + - 'spec/unit/puppet/provider/ip6tables_spec.rb' + - 'spec/unit/puppet/type/firewall_spec.rb' + - 'spec/unit/puppet/type/firewallchain_spec.rb' + +# Offense count: 22 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowConsecutiveOneLiners. +RSpec/EmptyLineAfterHook: + Exclude: + - 'spec/acceptance/firewall_attributes_exceptions_spec.rb' + - 'spec/acceptance/firewall_attributes_ipv6_exceptions_spec.rb' + - 'spec/acceptance/firewall_attributes_ipv6_happy_path_spec.rb' + - 'spec/unit/facter/iptables_persistent_version_spec.rb' + - 'spec/unit/facter/iptables_spec.rb' + - 'spec/unit/puppet/type/firewallchain_spec.rb' + +# Offense count: 22 +# Configuration parameters: CountAsOne. +RSpec/ExampleLength: + Max: 16 + +# Offense count: 41 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: single_line_only, single_statement_only, disallow, require_implicit +RSpec/ImplicitSubject: + Exclude: + - 'spec/unit/classes/firewall_linux_archlinux_spec.rb' + - 'spec/unit/classes/firewall_linux_debian_spec.rb' + - 'spec/unit/classes/firewall_linux_redhat_spec.rb' + +# Offense count: 44 +RSpec/MultipleExpectations: + Max: 6 + +# Offense count: 16 +# Configuration parameters: AllowedGroups. +RSpec/NestedGroups: + Max: 5 + +# Offense count: 66 +# Configuration parameters: AllowedPatterns. +# AllowedPatterns: ^expect_, ^assert_ +RSpec/NoExpectationExample: + Exclude: + - 'spec/acceptance/class_spec.rb' + - 'spec/acceptance/firewall_attributes_exceptions_spec.rb' + - 'spec/acceptance/firewall_attributes_ipv6_exceptions_spec.rb' + - 'spec/acceptance/firewallchain_spec.rb' + - 'spec/acceptance/rules_spec.rb' + - 'spec/acceptance/standard_usage_spec.rb' + - 'spec/unit/puppet/provider/ip6tables_spec.rb' + - 'spec/unit/puppet/provider/iptables_chain_spec.rb' + - 'spec/unit/puppet/provider/iptables_spec.rb' + - 'spec/unit/puppet/type/firewall_spec.rb' + - 'spec/unit/puppet/type/firewallchain_spec.rb' + - 'spec/unit/puppet/util/firewall_spec.rb' + - 'spec/unit/puppet/util/ipcidr_spec.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +RSpec/ReceiveNever: + Exclude: + - 'spec/unit/puppet/util/firewall_spec.rb' + +# Offense count: 3 +RSpec/RepeatedExampleGroupBody: + Exclude: + - 'spec/unit/classes/firewall_linux_debian_spec.rb' + +# Offense count: 8 +RSpec/RepeatedExampleGroupDescription: + Exclude: + - 'spec/acceptance/firewall_attributes_exceptions_spec.rb' + - 'spec/acceptance/resource_cmd_spec.rb' + +# Offense count: 3 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: . +# SupportedStyles: constant, string +RSpec/VerifiedDoubleReference: + EnforcedStyle: string + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: nested, compact +Style/ClassAndModuleChildren: + Exclude: + - 'lib/puppet/util/ipcidr.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +Style/CollectionCompact: + Exclude: + - 'lib/puppet/provider/firewall/iptables.rb' + +# Offense count: 1 +Style/CombinableLoops: + Exclude: + - 'spec/unit/puppet/type/firewall_spec.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +Style/ConcatArrayLiterals: + Exclude: + - 'lib/puppet/provider/firewall/iptables.rb' + +# Offense count: 90 +# This cop supports safe autocorrection (--autocorrect). +Style/IfUnlessModifier: + Exclude: + - 'lib/puppet/provider/firewall.rb' + - 'lib/puppet/provider/firewall/ip6tables.rb' + - 'lib/puppet/provider/firewall/iptables.rb' + - 'lib/puppet/provider/firewallchain/iptables_chain.rb' + - 'lib/puppet/type/firewall.rb' + - 'lib/puppet/type/firewallchain.rb' + - 'lib/puppet/util/firewall.rb' + - 'spec/acceptance/class_spec.rb' + - 'spec/acceptance/firewall_attributes_happy_path_spec.rb' + - 'spec/acceptance/firewall_duplicate_comment_spec.rb' + - 'spec/acceptance/rules_spec.rb' + - 'spec/spec_helper_acceptance_local.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AllowedMethods. +# AllowedMethods: nonzero? +Style/IfWithBooleanLiteralBranches: + Exclude: + - 'spec/acceptance/firewall_attributes_exceptions_spec.rb' + +# Offense count: 1 +Style/MixinUsage: + Exclude: + - 'spec/spec_helper.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Style/NegatedIfElseCondition: + Exclude: + - 'lib/puppet/type/firewallchain.rb' + +# Offense count: 9 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns. +# SupportedStyles: predicate, comparison +Style/NumericPredicate: + Exclude: + - 'spec/**/*' + - 'lib/puppet/provider/firewall/ip6tables.rb' + - 'lib/puppet/provider/firewall/iptables.rb' + - 'lib/puppet/type/firewall.rb' + - 'lib/puppet/util/firewall.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: same_as_string_literals, single_quotes, double_quotes +Style/QuotedSymbols: + Exclude: + - 'lib/puppet/type/firewall.rb' + +# Offense count: 5 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: Methods. +Style/RedundantArgument: + Exclude: + - 'lib/puppet/provider/firewall/iptables.rb' + - 'spec/spec_helper_acceptance_local.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Style/RedundantAssignment: + Exclude: + - 'spec/acceptance/firewall_duplicate_comment_spec.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +Style/RedundantRegexpCharacterClass: + Exclude: + - 'lib/puppet/type/firewall.rb' + +# Offense count: 113 +# This cop supports safe autocorrection (--autocorrect). +Style/RedundantRegexpEscape: + Exclude: + - 'lib/puppet/provider/firewall/iptables.rb' + - 'lib/puppet/type/firewall.rb' + - 'spec/acceptance/firewall_attributes_exceptions_spec.rb' + - 'spec/acceptance/firewall_attributes_happy_path_spec.rb' + - 'spec/acceptance/firewall_attributes_ipv6_exceptions_spec.rb' + - 'spec/acceptance/firewall_attributes_ipv6_happy_path_spec.rb' + - 'spec/acceptance/rules_spec.rb' + - 'spec/unit/puppet/provider/iptables_spec.rb' + - 'spec/unit/puppet/type/firewall_spec.rb' + +# Offense count: 8 +# This cop supports safe autocorrection (--autocorrect). +Style/RedundantStringEscape: + Exclude: + - 'spec/acceptance/firewall_attributes_exceptions_spec.rb' + - 'spec/acceptance/resource_cmd_spec.rb' + +# Offense count: 4 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: implicit, explicit +Style/RescueStandardError: + Exclude: + - 'lib/puppet/util/firewall.rb' + - 'spec/spec_helper.rb' + - 'spec/spec_helper_acceptance_local.rb' + +# Offense count: 2 +# This cop supports unsafe autocorrection (--autocorrect-all). +Style/SlicingWithRange: + Exclude: + - 'lib/puppet/provider/firewall/iptables.rb' + - 'spec/spec_helper_acceptance_local.rb' + +# Offense count: 16 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowModifier. +Style/SoleNestedConditional: + Exclude: + - 'lib/puppet/type/firewall.rb' + +# Offense count: 6 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: Mode. +Style/StringConcatenation: + Exclude: + - 'lib/puppet/provider/firewall/iptables.rb' + - 'lib/puppet/provider/firewallchain/iptables_chain.rb' + - 'lib/puppet/type/firewall.rb' + - 'lib/puppet/util/firewall.rb' + - 'spec/unit/puppet/type/firewallchain_spec.rb' + +# Offense count: 4 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AllowMethodsWithArguments, AllowedMethods, AllowedPatterns, AllowComments. +# AllowedMethods: define_method +Style/SymbolProc: + Exclude: + - 'lib/puppet/provider/firewall/iptables.rb' + - 'lib/puppet/type/firewall.rb' + +# Offense count: 46 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyleForMultiline. +# SupportedStylesForMultiline: comma, consistent_comma, no_comma +Style/TrailingCommaInHashLiteral: + Exclude: + - 'lib/puppet/provider/firewall/ip6tables.rb' + - 'lib/puppet/provider/firewall/iptables.rb' + - 'lib/puppet/provider/firewallchain/iptables_chain.rb' + - 'spec/spec_helper.rb' + - 'spec/spec_helper_local.rb' + - 'spec/unit/classes/firewall_linux_archlinux_spec.rb' + - 'spec/unit/classes/firewall_linux_debian_spec.rb' + - 'spec/unit/classes/firewall_linux_redhat_spec.rb' + - 'spec/unit/classes/firewall_linux_spec.rb' + - 'spec/unit/facter/iptables_persistent_version_spec.rb' + - 'spec/unit/puppet/type/firewall_spec.rb' diff --git a/Gemfile b/Gemfile index a84b5ee..8083564 100644 --- a/Gemfile +++ b/Gemfile @@ -30,9 +30,9 @@ group :development do gem "pry", '~> 0.10', require: false gem "simplecov-console", '~> 0.5', require: false gem "puppet-debugger", '~> 1.0', require: false - gem "rubocop", '= 1.6.1', require: false - gem "rubocop-performance", '= 1.9.1', require: false - gem "rubocop-rspec", '= 2.0.1', require: false + gem "rubocop", '= 1.48.1', require: false + gem "rubocop-performance", '= 1.16.0', require: false + gem "rubocop-rspec", '= 2.19.0', require: false gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] gem "github_changelog_generator", '= 1.15.2', require: false end