diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e7b40e9..041b862 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,6 +15,8 @@ jobs: rubocop: name: Rubocop uses: theforeman/actions/.github/workflows/rubocop.yml@v0 + with: + command: bundle exec rubocop --parallel --format github test_ruby: name: Ruby diff --git a/.rubocop.yml b/.rubocop.yml index bc2870c..ab6b63f 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,10 +1,8 @@ inherit_from: .rubocop_todo.yml -require: - - rubocop-performance - -AllCops: - NewCops: enable +inherit_gem: + theforeman-rubocop: + - strictest.yml Layout/LineLength: Enabled: false @@ -12,15 +10,9 @@ Layout/LineLength: Metrics: Enabled: false -Style/HashSyntax: - EnforcedStyle: no_mixed_keys - Style/SymbolArray: EnforcedStyle: brackets -Style/Documentation: - Enabled: false - Style/StringLiterals: Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 95495ec..4a970dd 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,13 +1,13 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2024-03-14 13:38:49 UTC using RuboCop version 1.57.2. +# on 2024-03-20 10:44:02 UTC using RuboCop version 1.23.0. # 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: 2 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. # Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include. # Include: **/*.gemspec Gemspec/OrderedDependencies: @@ -15,61 +15,46 @@ Gemspec/OrderedDependencies: - 'foreman_azure_rm.gemspec' # Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: Severity, Include. -# Include: **/*.gemspec -Gemspec/RequireMFA: - Exclude: - - 'foreman_azure_rm.gemspec' - -# Offense count: 1 -# Configuration parameters: Severity, Include. +# Configuration parameters: Include. # Include: **/*.gemspec Gemspec/RequiredRubyVersion: Exclude: - 'foreman_azure_rm.gemspec' -# Offense count: 3 -# This cop supports safe autocorrection (--autocorrect). +# Offense count: 30 +# Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, IndentationWidth. # SupportedStyles: with_first_argument, with_fixed_indentation Layout/ArgumentAlignment: Exclude: + - 'app/models/concerns/foreman_azure_rm/vm_extensions/managed_vm.rb' + - 'app/models/foreman_azure_rm/azure_rm.rb' - 'lib/foreman_azure_rm/azure_sdk_adapter.rb' # Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, IndentOneStep, IndentationWidth. # SupportedStyles: case, end Layout/CaseIndentation: Exclude: - 'app/controllers/foreman_azure_rm/concerns/compute_resources_controller_extensions.rb' -# Offense count: 16 -# This cop supports safe autocorrection (--autocorrect). -Layout/EmptyLineAfterGuardClause: - Exclude: - - 'app/models/concerns/foreman_azure_rm/vm_extensions/managed_vm.rb' - - 'app/models/foreman_azure_rm/azure_rm.rb' - - 'app/models/foreman_azure_rm/azure_rm_compute.rb' - - 'lib/foreman_azure_rm/azure_sdk_adapter.rb' - # Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EmptyLineBetweenMethodDefs, EmptyLineBetweenClassDefs, EmptyLineBetweenModuleDefs, DefLikeMacros, AllowAdjacentOneLineDefs, NumberOfEmptyLines. +# Cop supports --auto-correct. +# Configuration parameters: EmptyLineBetweenMethodDefs, EmptyLineBetweenClassDefs, EmptyLineBetweenModuleDefs, AllowAdjacentOneLineDefs, NumberOfEmptyLines. Layout/EmptyLineBetweenDefs: Exclude: - 'app/helpers/azure_compute_resource_helper.rb' # Offense count: 4 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. Layout/EmptyLines: Exclude: - 'test/azure_rm_test_helper.rb' - 'test/unit/azure_rm_test.rb' # Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. # Configuration parameters: AllowAliasSyntax, AllowedMethods. # AllowedMethods: alias_method, public, protected, private Layout/EmptyLinesAroundAttributeAccessor: @@ -77,7 +62,7 @@ Layout/EmptyLinesAroundAttributeAccessor: - 'app/models/foreman_azure_rm/azure_rm.rb' # Offense count: 2 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines, beginning_only, ending_only Layout/EmptyLinesAroundClassBody: @@ -86,7 +71,7 @@ Layout/EmptyLinesAroundClassBody: - 'app/models/foreman_azure_rm/azure_rm_compute.rb' # Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines Layout/EmptyLinesAroundModuleBody: @@ -94,7 +79,7 @@ Layout/EmptyLinesAroundModuleBody: - 'app/models/concerns/foreman_azure_rm/vm_extensions/managed_vm.rb' # Offense count: 6 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. # Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment. Layout/ExtraSpacing: Exclude: @@ -103,7 +88,7 @@ Layout/ExtraSpacing: - 'lib/foreman_azure_rm/azure_sdk_adapter.rb' # Offense count: 2 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, IndentationWidth. # SupportedStyles: consistent, consistent_relative_to_receiver, special_for_inner_method_call, special_for_inner_method_call_in_parentheses Layout/FirstArgumentIndentation: @@ -112,7 +97,7 @@ Layout/FirstArgumentIndentation: - 'lib/foreman_azure_rm/azure_sdk_adapter.rb' # Offense count: 6 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, IndentationWidth. # SupportedStyles: special_inside_parentheses, consistent, align_braces Layout/FirstHashElementIndentation: @@ -120,8 +105,8 @@ Layout/FirstHashElementIndentation: - 'app/models/concerns/foreman_azure_rm/vm_extensions/managed_vm.rb' - 'test/azure_rm_test_helper.rb' -# Offense count: 28 -# This cop supports safe autocorrection (--autocorrect). +# Offense count: 21 +# Cop supports --auto-correct. # Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle. # SupportedHashRocketStyles: key, separator, table # SupportedColonStyles: key, separator, table @@ -133,7 +118,7 @@ Layout/HashAlignment: - 'lib/foreman_azure_rm/engine.rb' # Offense count: 2 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. # Configuration parameters: IndentationWidth, EnforcedStyle. # SupportedStyles: spaces, tabs Layout/IndentationStyle: @@ -141,8 +126,8 @@ Layout/IndentationStyle: - 'app/models/foreman_azure_rm/azure_rm.rb' # Offense count: 3 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: Width, AllowedPatterns. +# Cop supports --auto-correct. +# Configuration parameters: Width, IgnoredPatterns. Layout/IndentationWidth: Exclude: - 'app/models/concerns/foreman_azure_rm/vm_extensions/managed_vm.rb' @@ -150,7 +135,7 @@ Layout/IndentationWidth: - 'app/models/foreman_azure_rm/azure_rm_compute.rb' # Offense count: 3 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. # Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment. Layout/LeadingCommentSpace: Exclude: @@ -159,7 +144,7 @@ Layout/LeadingCommentSpace: - 'lib/foreman_azure_rm/engine.rb' # Offense count: 2 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: symmetrical, new_line, same_line Layout/MultilineMethodCallBraceLayout: @@ -168,7 +153,7 @@ Layout/MultilineMethodCallBraceLayout: - 'lib/foreman_azure_rm/azure_sdk_adapter.rb' # Offense count: 11 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, IndentationWidth. # SupportedStyles: aligned, indented Layout/MultilineOperationIndentation: @@ -177,20 +162,20 @@ Layout/MultilineOperationIndentation: - 'test/unit/azure_rm_test.rb' # Offense count: 2 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. Layout/SpaceAfterColon: Exclude: - 'app/models/foreman_azure_rm/azure_rm.rb' - 'lib/foreman_azure_rm/azure_sdk_adapter.rb' # Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. Layout/SpaceAfterComma: Exclude: - 'lib/foreman_azure_rm/azure_sdk_adapter.rb' # Offense count: 6 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. # Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator. # SupportedStylesForExponentOperator: space, no_space Layout/SpaceAroundOperators: @@ -201,7 +186,7 @@ Layout/SpaceAroundOperators: - 'test/unit/azure_rm_test.rb' # Offense count: 2 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces. # SupportedStyles: space, no_space # SupportedStylesForEmptyBraces: space, no_space @@ -211,7 +196,7 @@ Layout/SpaceBeforeBlockBraces: - 'lib/foreman_azure_rm/engine.rb' # Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: require_no_space, require_space Layout/SpaceInLambdaLiteral: @@ -219,7 +204,7 @@ Layout/SpaceInLambdaLiteral: - 'lib/foreman_azure_rm/engine.rb' # Offense count: 5 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces. # SupportedStyles: space, no_space, compact # SupportedStylesForEmptyBraces: space, no_space @@ -230,7 +215,7 @@ Layout/SpaceInsideHashLiteralBraces: - 'test/azure_rm_test_helper.rb' # Offense count: 11 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: final_newline, final_blank_line Layout/TrailingEmptyLines: @@ -248,7 +233,7 @@ Layout/TrailingEmptyLines: - 'test/test_plugin_helper.rb' # Offense count: 3 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. # Configuration parameters: AllowInHeredoc. Layout/TrailingWhitespace: Exclude: @@ -277,13 +262,13 @@ Lint/RescueException: - 'app/helpers/azure_compute_resource_helper.rb' # Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. Lint/ScriptPermission: Exclude: - 'Rakefile' # Offense count: 2 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. Lint/SendWithMixinArgument: Exclude: - 'lib/foreman_azure_rm/engine.rb' @@ -294,14 +279,14 @@ Lint/ShadowingOuterLocalVariable: - 'app/models/foreman_azure_rm/azure_rm.rb' # Offense count: 1 -# Configuration parameters: AllowedPatterns. -# AllowedPatterns: (?-mix:(exactly|at_least|at_most)\(\d+\)\.times) +# Configuration parameters: IgnoredPatterns. +# IgnoredPatterns: (?-mix:(exactly|at_least|at_most)\(\d+\)\.times) Lint/UnreachableLoop: Exclude: - 'lib/foreman_azure_rm/azure_sdk_adapter.rb' # Offense count: 8 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. # Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments. Lint/UnusedBlockArgument: Exclude: @@ -310,14 +295,13 @@ Lint/UnusedBlockArgument: - 'test/unit/azure_rm_test.rb' # Offense count: 3 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods. Lint/UnusedMethodArgument: Exclude: - 'app/models/foreman_azure_rm/azure_rm.rb' # Offense count: 8 -# This cop supports unsafe autocorrection (--autocorrect-all). Lint/UselessAssignment: Exclude: - 'app/helpers/azure_compute_resource_helper.rb' @@ -327,12 +311,20 @@ Lint/UselessAssignment: - 'lib/foreman_azure_rm/azure_sdk_adapter.rb' # Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: CheckForMethodsWithNoSideEffects. Lint/Void: Exclude: - 'test/azure_rm_test_helper.rb' +# Offense count: 1 +Minitest/AssertWithExpectedArgument: + Exclude: + - 'test/unit/azure_rm_test.rb' + +# Offense count: 1 +Minitest/MultipleAssertions: + Max: 6 + # Offense count: 1 Naming/AccessorMethodName: Exclude: @@ -340,14 +332,14 @@ Naming/AccessorMethodName: # Offense count: 4 # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. -# AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to +# AllowedNames: at, by, db, id, in, io, ip, of, on, os, pp, to Naming/MethodParameterName: Exclude: - 'app/helpers/azure_compute_resource_helper.rb' - 'app/models/foreman_azure_rm/azure_rm.rb' # Offense count: 2 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. # Configuration parameters: PreferredName. Naming/RescuedExceptionsVariableName: Exclude: @@ -355,59 +347,82 @@ Naming/RescuedExceptionsVariableName: - 'app/helpers/azure_compute_resource_helper.rb' # Offense count: 1 -# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: MinSize. +Performance/CollectionLiteralInLoop: + Exclude: + - 'app/models/foreman_azure_rm/azure_rm_compute.rb' + +# Offense count: 1 +# Cop supports --auto-correct. Performance/Detect: Exclude: - 'app/models/concerns/foreman_azure_rm/vm_extensions/managed_vm.rb' -# Offense count: 8 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: separated, grouped -Style/AccessorGrouping: +# Offense count: 7 +# Cop supports --auto-correct. +# Configuration parameters: NilOrEmpty, NotPresent, UnlessPresent. +Rails/Blank: Exclude: + - 'app/models/foreman_azure_rm/azure_rm.rb' - 'app/models/foreman_azure_rm/azure_rm_compute.rb' + - 'lib/foreman_azure_rm/azure_sdk_adapter.rb' -# Offense count: 2 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: prefer_alias, prefer_alias_method -Style/Alias: +# Offense count: 6 +# Cop supports --auto-correct. +# Configuration parameters: Whitelist, AllowedMethods, AllowedReceivers. +# Whitelist: find_by_sql +# AllowedMethods: find_by_sql +# AllowedReceivers: Gem::Specification +Rails/DynamicFindBy: + Exclude: + - 'app/controllers/foreman_azure_rm/concerns/compute_resources_controller_extensions.rb' + - 'app/controllers/foreman_azure_rm/concerns/hosts_controller_extensions.rb' + +# Offense count: 1 +# Configuration parameters: Include. +# Include: app/models/**/*.rb +Rails/InverseOf: Exclude: - 'app/models/foreman_azure_rm/azure_rm.rb' + +# Offense count: 5 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, Include. +# SupportedStyles: assert_not, refute +# Include: **/test/**/* +Rails/RefuteMethods: + Exclude: + - 'test/unit/azure_rm_test.rb' + +# Offense count: 8 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: separated, grouped +Style/AccessorGrouping: + Exclude: - 'app/models/foreman_azure_rm/azure_rm_compute.rb' # Offense count: 1 -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: AllowedReceivers. +# Cop supports --auto-correct. Style/CollectionCompact: Exclude: - 'app/models/foreman_azure_rm/azure_rm.rb' # Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. Style/ColonMethodCall: Exclude: - 'lib/foreman_azure_rm/engine.rb' -# Offense count: 4 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: compact, expanded -Style/EmptyMethod: - Exclude: - - 'app/models/foreman_azure_rm/azure_rm_compute.rb' - - 'db/migrate/20200507103900_fix_image_uuid_prefix.rb' - # Offense count: 2 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. Style/ExpandPathArguments: Exclude: - 'Rakefile' - 'foreman_azure_rm.gemspec' # Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: format, sprintf, percent Style/FormatString: @@ -415,22 +430,36 @@ Style/FormatString: - 'app/models/foreman_azure_rm/azure_rm_compute.rb' # Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: MaxUnannotatedPlaceholdersAllowed, AllowedMethods, AllowedPatterns. +# Configuration parameters: MaxUnannotatedPlaceholdersAllowed, IgnoredMethods. # SupportedStyles: annotated, template, unannotated Style/FormatStringToken: EnforcedStyle: template -# Offense count: 3 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: MinBodyLength, AllowConsecutiveConditionals. +# Offense count: 4 +# Configuration parameters: MinBodyLength. Style/GuardClause: Exclude: - 'app/models/concerns/foreman_azure_rm/vm_extensions/managed_vm.rb' - 'app/models/foreman_azure_rm/azure_rm_compute.rb' +# Offense count: 54 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols. +# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys +Style/HashSyntax: + Exclude: + - 'app/controllers/foreman_azure_rm/concerns/compute_resources_controller_extensions.rb' + - 'app/controllers/foreman_azure_rm/concerns/hosts_controller_extensions.rb' + - 'app/helpers/azure_compute_resource_helper.rb' + - 'app/models/foreman_azure_rm/azure_rm.rb' + - 'app/models/foreman_azure_rm/azure_rm_compute.rb' + - 'config/routes.rb' + - 'lib/foreman_azure_rm/engine.rb' + - 'test/factories/azure.rb' + - 'test/unit/azure_rm_test.rb' + # Offense count: 3 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. Style/IfUnlessModifier: Exclude: - 'app/models/foreman_azure_rm/azure_rm.rb' @@ -438,8 +467,8 @@ Style/IfUnlessModifier: - 'lib/foreman_azure_rm/azure_sdk_adapter.rb' # Offense count: 7 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowedMethods, AllowedPatterns. +# Cop supports --auto-correct. +# Configuration parameters: IgnoredMethods. Style/MethodCallWithoutArgsParentheses: Exclude: - 'lib/foreman_azure_rm/azure_sdk_adapter.rb' @@ -452,7 +481,7 @@ Style/MultilineBlockChain: - 'app/models/foreman_azure_rm/azure_rm.rb' # Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, MinBodyLength. # SupportedStyles: skip_modifier_ifs, always Style/Next: @@ -466,31 +495,31 @@ Style/OpenStructUse: - 'app/models/foreman_azure_rm/azure_rm_compute.rb' # Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. Style/RedundantAssignment: Exclude: - 'app/models/concerns/foreman_azure_rm/vm_extensions/managed_vm.rb' # Offense count: 4 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. Style/RedundantException: Exclude: - 'app/models/concerns/foreman_azure_rm/vm_extensions/managed_vm.rb' # Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. Style/RedundantFileExtensionInRequire: Exclude: - 'lib/foreman_azure_rm.rb' # Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. Style/RedundantParentheses: Exclude: - 'app/models/foreman_azure_rm/azure_rm_compute.rb' -# Offense count: 7 -# This cop supports safe autocorrection (--autocorrect). +# Offense count: 6 +# Cop supports --auto-correct. # Configuration parameters: AllowMultipleReturnValues. Style/RedundantReturn: Exclude: @@ -498,7 +527,7 @@ Style/RedundantReturn: - 'app/models/foreman_azure_rm/azure_rm_compute.rb' # Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, AllowInnerSlashes. # SupportedStyles: slashes, percent_r, mixed Style/RegexpLiteral: @@ -506,7 +535,7 @@ Style/RegexpLiteral: - 'lib/foreman_azure_rm/engine.rb' # Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: implicit, explicit Style/RescueStandardError: @@ -514,22 +543,22 @@ Style/RescueStandardError: - 'Rakefile' # Offense count: 1 -# This cop supports unsafe autocorrection (--autocorrect-all). +# Cop supports --auto-correct. # Configuration parameters: Mode. Style/StringConcatenation: Exclude: - 'app/helpers/azure_compute_resource_helper.rb' # Offense count: 1 -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: AllowMethodsWithArguments, AllowedMethods, AllowedPatterns, AllowComments. -# AllowedMethods: define_method +# Cop supports --auto-correct. +# Configuration parameters: AllowMethodsWithArguments, IgnoredMethods. +# IgnoredMethods: respond_to, define_method Style/SymbolProc: Exclude: - 'app/controllers/foreman_azure_rm/concerns/hosts_controller_extensions.rb' # Offense count: 4 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. # Configuration parameters: EnforcedStyleForMultiline. # SupportedStylesForMultiline: comma, consistent_comma, no_comma Style/TrailingCommaInArguments: @@ -537,15 +566,25 @@ Style/TrailingCommaInArguments: - 'app/models/foreman_azure_rm/azure_rm.rb' # Offense count: 2 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyleForMultiline. +# SupportedStylesForMultiline: comma, consistent_comma, no_comma +Style/TrailingCommaInArrayLiteral: + Exclude: + - 'app/models/concerns/foreman_azure_rm/vm_extensions/managed_vm.rb' + +# Offense count: 5 +# Cop supports --auto-correct. # Configuration parameters: EnforcedStyleForMultiline. # SupportedStylesForMultiline: comma, consistent_comma, no_comma Style/TrailingCommaInHashLiteral: Exclude: + - 'app/models/concerns/foreman_azure_rm/vm_extensions/managed_vm.rb' + - 'lib/foreman_azure_rm/azure_sdk_adapter.rb' - 'test/azure_rm_test_helper.rb' # Offense count: 4 -# This cop supports safe autocorrection (--autocorrect). +# Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, MinSize, WordRegex. # SupportedStyles: percent, brackets Style/WordArray: diff --git a/Gemfile b/Gemfile index 883069a..67e6183 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,4 @@ gemspec name: 'foreman_azure_rm' gem 'rake', '~> 13.0' -group :test do - gem 'rubocop', '~> 1.57.0' - gem 'rubocop-performance', '~> 1.5.2' -end +gem 'theforeman-rubocop', '~> 0.1.0' diff --git a/Rakefile b/Rakefile index 740b71e..838115b 100644 --- a/Rakefile +++ b/Rakefile @@ -1,4 +1,3 @@ -#!/usr/bin/env rake begin require 'bundler/setup' rescue LoadError @@ -44,4 +43,4 @@ end task :default do Rake::Task['rubocop'].execute -end \ No newline at end of file +end