Skip to content
Snippets Groups Projects
Commit e8e1bca3ac2f authored by Gabriel Mazetto's avatar Gabriel Mazetto
Browse files

Fix rubocop violations

parent 8832ca4ff484
No related branches found
No related tags found
2 merge requests!55Intermediate build after shift of stable series,!54GitLab 14.4
......@@ -97,14 +97,6 @@
- 'spec/chef_helper.rb'
- 'spec/spec_helper.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: AllowedMethods.
# AllowedMethods: instance_of?, kind_of?, is_a?, eql?, respond_to?, equal?
Lint/RedundantSafeNavigation:
Exclude:
- 'files/gitlab-cookbooks/package/libraries/helpers/settings_helper.rb'
# Offense count: 2
# Configuration parameters: IgnoredMethods.
Metrics/CyclomaticComplexity:
......@@ -187,7 +179,6 @@
Exclude:
- 'files/gitlab-cookbooks/gitlab/libraries/helpers/base_pg_helper.rb'
- 'files/gitlab-cookbooks/gitlab/libraries/helpers/pg_status_helper.rb'
- 'files/gitlab-cookbooks/package/libraries/helpers/settings_helper.rb'
# Offense count: 3
# Cop supports --auto-correct.
......@@ -345,7 +336,6 @@
Exclude:
- 'config/software/rubygems.rb'
- 'files/gitlab-cookbooks/gitlab/libraries/redis_helper.rb'
- 'files/gitlab-cookbooks/package/libraries/helpers/settings_helper.rb'
# Offense count: 1
# Cop supports --auto-correct.
......
......@@ -28,8 +28,7 @@
def self.extended(base)
# Setup getter/setters for roles and settings
class << base
attr_accessor :available_roles
attr_accessor :settings
attr_accessor :available_roles, :settings
end
base.available_roles = {}
......@@ -161,7 +160,7 @@
DefaultRole.load_role
@available_roles.each do |key, value|
handler = value.handler
handler.load_role if handler && handler.respond_to?(:load_role)
handler.load_role if handler.respond_to?(:load_role)
end
end
......@@ -172,7 +171,7 @@
# Parse secrets using the handlers
sorted_settings.each do |_key, value|
handler = value.handler
handler.parse_secrets if handler && handler.respond_to?(:parse_secrets)
handler.parse_secrets if handler.respond_to?(:parse_secrets)
end
SecretsHelper.write_to_gitlab_secrets
......@@ -184,7 +183,7 @@
# Parse all our variables using the handlers
sorted_settings.each do |_key, value|
handler = value.handler
handler.parse_variables if handler && handler.respond_to?(:parse_variables)
handler.parse_variables if handler.respond_to?(:parse_variables)
end
# The last step is to convert underscores to hyphens in top-level keys
strip_nils(hyphenate_config_keys)
......@@ -222,7 +221,7 @@
end
def handler
@handler = @handler.call if @handler&.respond_to?(:call)
@handler = @handler.call if @handler.respond_to?(:call)
@handler
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment