From 5b52e2872199abaa79a0d665e7d69c06b9159ba0 Mon Sep 17 00:00:00 2001 From: Leos Stejskal Date: Thu, 14 Mar 2024 12:51:09 +0100 Subject: [PATCH] Move task to lib/tasks --- .rubocop.yml | 3 +++ .rubocop_todo.yml | 36 ++++++++++++++---------------------- Gemfile | 9 ++++++++- foreman_azure_rm.gemspec | 3 --- 4 files changed, 25 insertions(+), 26 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index b008f15..bc2870c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,5 +1,8 @@ inherit_from: .rubocop_todo.yml +require: + - rubocop-performance + AllCops: NewCops: enable diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index ea74a96..95495ec 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,28 +1,12 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2024-03-14 11:01:11 UTC using RuboCop version 1.50.2. +# on 2024-03-14 13:38:49 UTC using RuboCop version 1.57.2. # 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: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: Severity, Include. -# Include: **/*.gemspec -Gemspec/DeprecatedAttributeAssignment: - Exclude: - - 'foreman_azure_rm.gemspec' - -# Offense count: 1 -# Configuration parameters: EnforcedStyle, AllowedGems, Include. -# SupportedStyles: Gemfile, gems.rb, gemspec -# Include: **/*.gemspec, **/Gemfile, **/gems.rb -Gemspec/DevelopmentDependencies: - Exclude: - - 'foreman_azure_rm.gemspec' - -# Offense count: 3 +# Offense count: 2 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include. # Include: **/*.gemspec @@ -72,7 +56,7 @@ Layout/EmptyLineAfterGuardClause: # Offense count: 1 # This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EmptyLineBetweenMethodDefs, EmptyLineBetweenClassDefs, EmptyLineBetweenModuleDefs, AllowAdjacentOneLineDefs, NumberOfEmptyLines. +# Configuration parameters: EmptyLineBetweenMethodDefs, EmptyLineBetweenClassDefs, EmptyLineBetweenModuleDefs, DefLikeMacros, AllowAdjacentOneLineDefs, NumberOfEmptyLines. Layout/EmptyLineBetweenDefs: Exclude: - 'app/helpers/azure_compute_resource_helper.rb' @@ -245,13 +229,12 @@ Layout/SpaceInsideHashLiteralBraces: - 'app/models/foreman_azure_rm/azure_rm_compute.rb' - 'test/azure_rm_test_helper.rb' -# Offense count: 12 +# Offense count: 11 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: final_newline, final_blank_line Layout/TrailingEmptyLines: Exclude: - - 'Gemfile' - 'Rakefile' - 'app/controllers/foreman_azure_rm/concerns/compute_resources_controller_extensions.rb' - 'app/views/api/v2/compute_resources/available_resource_groups.rabl' @@ -334,6 +317,7 @@ Lint/UnusedMethodArgument: - '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' @@ -343,6 +327,7 @@ 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: @@ -369,6 +354,12 @@ Naming/RescuedExceptionsVariableName: - 'Rakefile' - 'app/helpers/azure_compute_resource_helper.rb' +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +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. @@ -388,6 +379,7 @@ Style/Alias: # Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AllowedReceivers. Style/CollectionCompact: Exclude: - 'app/models/foreman_azure_rm/azure_rm.rb' @@ -497,7 +489,7 @@ Style/RedundantParentheses: Exclude: - 'app/models/foreman_azure_rm/azure_rm_compute.rb' -# Offense count: 6 +# Offense count: 7 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AllowMultipleReturnValues. Style/RedundantReturn: diff --git a/Gemfile b/Gemfile index cd8aa9e..883069a 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,10 @@ source 'https://rubygems.org' -gemspec \ No newline at end of file +gemspec name: 'foreman_azure_rm' + +gem 'rake', '~> 13.0' + +group :test do + gem 'rubocop', '~> 1.57.0' + gem 'rubocop-performance', '~> 1.5.2' +end diff --git a/foreman_azure_rm.gemspec b/foreman_azure_rm.gemspec index 30987c4..405b2ba 100644 --- a/foreman_azure_rm.gemspec +++ b/foreman_azure_rm.gemspec @@ -4,7 +4,6 @@ require 'date' Gem::Specification.new do |s| s.name = 'foreman_azure_rm' s.version = ForemanAzureRm::VERSION - s.date = Date.today.to_s s.authors = ['Aditi Puntambekar', 'Shimon Shtein', 'Tyler Gregory'] s.email = ['puntambekaraditi@gmail.com', 'shteinshim@gmail.com', 'tdgregory@protonmail.com'] s.summary = 'Azure Resource Manager as a compute resource for The Foreman' @@ -18,6 +17,4 @@ Gem::Specification.new do |s| s.add_dependency 'azure_mgmt_storage', '~> 0.23.0' s.add_dependency 'azure_mgmt_compute', '~> 0.22.0' s.add_dependency 'azure_mgmt_subscriptions', '~> 0.18.5' - s.add_development_dependency 'rubocop' - s.add_development_dependency 'mocha', '~> 1.2', '>= 1.2.1' end