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

Fix ConstantName rubocop offense

parent fa3528ee
...@@ -107,12 +107,6 @@ Lint/UriEscapeUnescape: ...@@ -107,12 +107,6 @@ Lint/UriEscapeUnescape:
Metrics/LineLength: Metrics/LineLength:
Max: 1310 Max: 1310
# Offense count: 2
Naming/ConstantName:
Exclude:
- 'lib/gitlab/import_sources.rb'
- 'lib/gitlab/ssh_public_key.rb'
# Offense count: 11 # Offense count: 11
# Configuration parameters: EnforcedStyle. # Configuration parameters: EnforcedStyle.
# SupportedStyles: lowercase, uppercase # SupportedStyles: lowercase, uppercase
......
...@@ -10,7 +10,7 @@ module Gitlab ...@@ -10,7 +10,7 @@ module Gitlab
ImportSource = Struct.new(:name, :title, :importer) ImportSource = Struct.new(:name, :title, :importer)
# We exclude `bare_repository` here as it has no import class associated # We exclude `bare_repository` here as it has no import class associated
ImportTable = [ IMPORT_TABLE = [
ImportSource.new('github', 'GitHub', Gitlab::GithubImport::ParallelImporter), ImportSource.new('github', 'GitHub', Gitlab::GithubImport::ParallelImporter),
ImportSource.new('bitbucket', 'Bitbucket Cloud', Gitlab::BitbucketImport::Importer), ImportSource.new('bitbucket', 'Bitbucket Cloud', Gitlab::BitbucketImport::Importer),
ImportSource.new('bitbucket_server', 'Bitbucket Server', Gitlab::BitbucketServerImport::Importer), ImportSource.new('bitbucket_server', 'Bitbucket Server', Gitlab::BitbucketServerImport::Importer),
...@@ -45,7 +45,7 @@ module Gitlab ...@@ -45,7 +45,7 @@ module Gitlab
end end
def import_table def import_table
ImportTable IMPORT_TABLE
end end
end end
end end
......
...@@ -4,7 +4,7 @@ module Gitlab ...@@ -4,7 +4,7 @@ module Gitlab
class SSHPublicKey class SSHPublicKey
Technology = Struct.new(:name, :key_class, :supported_sizes) Technology = Struct.new(:name, :key_class, :supported_sizes)
Technologies = [ TECHNOLOGIES = [
Technology.new(:rsa, OpenSSL::PKey::RSA, [1024, 2048, 3072, 4096]), Technology.new(:rsa, OpenSSL::PKey::RSA, [1024, 2048, 3072, 4096]),
Technology.new(:dsa, OpenSSL::PKey::DSA, [1024, 2048, 3072]), Technology.new(:dsa, OpenSSL::PKey::DSA, [1024, 2048, 3072]),
Technology.new(:ecdsa, OpenSSL::PKey::EC, [256, 384, 521]), Technology.new(:ecdsa, OpenSSL::PKey::EC, [256, 384, 521]),
...@@ -12,11 +12,11 @@ module Gitlab ...@@ -12,11 +12,11 @@ module Gitlab
].freeze ].freeze
def self.technology(name) 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 end
def self.technology_for_key(key) 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 end
def self.supported_sizes(name) 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