-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Use Foreman action - Fix Rubocop auto corrections - Add .rubocop_todo.yml
- Loading branch information
1 parent
ec715a3
commit 768ae14
Showing
33 changed files
with
554 additions
and
329 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
inherit_from: .rubocop_todo.yml | ||
|
||
AllCops: | ||
NewCops: enable | ||
|
||
Layout/LineLength: | ||
Enabled: false | ||
|
||
Metrics: | ||
Enabled: false | ||
|
||
Style/HashSyntax: | ||
EnforcedStyle: no_mixed_keys | ||
|
||
Style/SymbolArray: | ||
EnforcedStyle: brackets | ||
|
||
Style/Documentation: | ||
Enabled: false | ||
|
||
Style/StringLiterals: | ||
Enabled: false | ||
|
||
Style/FrozenStringLiteralComment: | ||
Enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
# This configuration was generated by | ||
# `rubocop --auto-gen-config` | ||
# on 2024-03-14 09:55:55 UTC using RuboCop version 1.50.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: 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. | ||
# Include: **/*.gemspec | ||
Gemspec/RequiredRubyVersion: | ||
Exclude: | ||
- 'foreman_azure_rm.gemspec' | ||
|
||
# Offense count: 1 | ||
# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches. | ||
Lint/DuplicateBranch: | ||
Exclude: | ||
- 'app/models/foreman_azure_rm/azure_rm.rb' | ||
|
||
# Offense count: 4 | ||
Lint/DuplicateMethods: | ||
Exclude: | ||
- 'app/models/foreman_azure_rm/azure_rm_compute.rb' | ||
|
||
# Offense count: 2 | ||
Lint/NoReturnInBeginEndBlocks: | ||
Exclude: | ||
- 'app/models/foreman_azure_rm/azure_rm_compute.rb' | ||
|
||
# Offense count: 1 | ||
Lint/RescueException: | ||
Exclude: | ||
- 'app/helpers/azure_compute_resource_helper.rb' | ||
|
||
# Offense count: 1 | ||
Lint/ShadowingOuterLocalVariable: | ||
Exclude: | ||
- 'app/models/foreman_azure_rm/azure_rm.rb' | ||
|
||
# Offense count: 1 | ||
# Configuration parameters: AllowedPatterns. | ||
# AllowedPatterns: (?-mix:(exactly|at_least|at_most)\(\d+\)\.times) | ||
Lint/UnreachableLoop: | ||
Exclude: | ||
- 'lib/foreman_azure_rm/azure_sdk_adapter.rb' | ||
|
||
# Offense count: 8 | ||
Lint/UselessAssignment: | ||
Exclude: | ||
- 'app/helpers/azure_compute_resource_helper.rb' | ||
- '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 | ||
# Configuration parameters: CheckForMethodsWithNoSideEffects. | ||
Lint/Void: | ||
Exclude: | ||
- 'test/azure_rm_test_helper.rb' | ||
|
||
# Offense count: 1 | ||
Naming/AccessorMethodName: | ||
Exclude: | ||
- 'lib/foreman_azure_rm/azure_sdk_adapter.rb' | ||
|
||
# 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 | ||
Naming/MethodParameterName: | ||
Exclude: | ||
- 'app/helpers/azure_compute_resource_helper.rb' | ||
- 'app/models/foreman_azure_rm/azure_rm.rb' | ||
|
||
# Offense count: 1 | ||
# This cop supports unsafe autocorrection (--autocorrect-all). | ||
Style/CollectionCompact: | ||
Exclude: | ||
- 'app/models/foreman_azure_rm/azure_rm.rb' | ||
|
||
# Offense count: 1 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
Style/IfUnlessModifier: | ||
Exclude: | ||
- 'app/models/foreman_azure_rm/azure_rm.rb' | ||
|
||
# Offense count: 1 | ||
Style/MultilineBlockChain: | ||
Exclude: | ||
- 'app/models/foreman_azure_rm/azure_rm.rb' | ||
|
||
# Offense count: 3 | ||
Style/OpenStructUse: | ||
Exclude: | ||
- 'app/models/foreman_azure_rm/azure_rm.rb' | ||
- 'app/models/foreman_azure_rm/azure_rm_compute.rb' | ||
|
||
# Offense count: 3 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
# Configuration parameters: MinSize. | ||
# SupportedStyles: percent, brackets | ||
Style/SymbolArray: | ||
EnforcedStyle: percent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.0.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
source 'https://rubygems.org' | ||
|
||
gemspec | ||
gemspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
# frozen_string_literal: true | ||
|
||
module AzureComputeResourceHelper | ||
def regions_list(azurerm_cr, f) | ||
begin | ||
regions = azurerm_cr.regions || [] | ||
rescue StandardError | ||
#do nothing | ||
# do nothing | ||
regions = [] | ||
rescue Exception => ex | ||
return information_box("Regions could not be loaded due to exception: #{ex}") | ||
rescue Exception => e | ||
return information_box("Regions could not be loaded due to exception: #{e}") | ||
end | ||
selectable_f(f, :url, regions, {}, {:label => _('Azure Region'), :disabled => regions.empty?, :required => true, :help_inline_permanent => load_button_f(f, regions.present?, _("Load Regions")) }) | ||
selectable_f(f, :url, regions, {}, | ||
{ label: _('Azure Region'), disabled: regions.empty?, required: true, help_inline_permanent: load_button_f(f, regions.present?, _('Load Regions')) }) | ||
end | ||
|
||
def azure_doc_version | ||
doc_version = Foreman::Plugin.find(:foreman_azure_rm).version.scan(/\d+\.\d+/).first + '.x' | ||
doc_version = "#{Foreman::Plugin.find(:foreman_azure_rm).version.scan(/\d+\.\d+/).first}.x" | ||
end | ||
end |
Oops, something went wrong.