Commit 7b982574 authored by Semyon Pupkov's avatar Semyon Pupkov

Fix ConstantName rubocop offense

parent fa3528ee
......@@ -107,12 +107,6 @@ Lint/UriEscapeUnescape:
Metrics/LineLength:
Max: 1310
# Offense count: 2
Naming/ConstantName:
Exclude:
- 'lib/gitlab/import_sources.rb'
- 'lib/gitlab/ssh_public_key.rb'
# Offense count: 11
# Configuration parameters: EnforcedStyle.
# SupportedStyles: lowercase, uppercase
......
......@@ -10,7 +10,7 @@ module Gitlab
ImportSource = Struct.new(:name, :title, :importer)
# We exclude `bare_repository` here as it has no import class associated
ImportTable = [
IMPORT_TABLE = [
ImportSource.new('github', 'GitHub', Gitlab::GithubImport::ParallelImporter),
ImportSource.new('bitbucket', 'Bitbucket Cloud', Gitlab::BitbucketImport::Importer),
ImportSource.new('bitbucket_server', 'Bitbucket Server', Gitlab::BitbucketServerImport::Importer),
......@@ -45,7 +45,7 @@ module Gitlab
end
def import_table
ImportTable
IMPORT_TABLE
end
end
end
......
......@@ -4,7 +4,7 @@ module Gitlab
class SSHPublicKey
Technology = Struct.new(:name, :key_class, :supported_sizes)
Technologies = [
TECHNOLOGIES = [
Technology.new(:rsa, OpenSSL::PKey::RSA, [1024, 2048, 3072, 4096]),
Technology.new(:dsa, OpenSSL::PKey::DSA, [1024, 2048, 3072]),
Technology.new(:ecdsa, OpenSSL::PKey::EC, [256, 384, 521]),
......@@ -12,11 +12,11 @@ module Gitlab
].freeze
def self.technology(name)
Technologies.find { |tech| tech.name.to_s == name.to_s }
TECHNOLOGIES.find { |tech| tech.name.to_s == name.to_s }
end
def self.technology_for_key(key)
Technologies.find { |tech| key.is_a?(tech.key_class) }
TECHNOLOGIES.find { |tech| key.is_a?(tech.key_class) }
end
def self.supported_sizes(name)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment