diff options
author | Rémy Coutable <remy@rymai.me> | 2018-12-12 10:44:13 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-12-12 10:44:13 +0000 |
commit | 7b1ea8cae2d43498f2eff02ead21977a90822ce1 (patch) | |
tree | e0bd00bd2da37eb4f01ae4a7e7d48bc4dc05d9ec | |
parent | f5eddb807440b1d41244d00323f8523179f24e16 (diff) | |
parent | 7b98257453acd72e8ab12eb4c4c362efa2161f36 (diff) | |
download | gitlab-ce-7b1ea8cae2d43498f2eff02ead21977a90822ce1.tar.gz |
Merge branch 'fix-rubocop-issues' into 'master'
Fix ConstantName rubocop offense
See merge request gitlab-org/gitlab-ce!23677
-rw-r--r-- | .rubocop_todo.yml | 6 | ||||
-rw-r--r-- | lib/gitlab/import_sources.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/ssh_public_key.rb | 6 |
3 files changed, 5 insertions, 11 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 571df7534cb..3ab76965287 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -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 diff --git a/lib/gitlab/import_sources.rb b/lib/gitlab/import_sources.rb index f46bb837cf7..67952ca0f2d 100644 --- a/lib/gitlab/import_sources.rb +++ b/lib/gitlab/import_sources.rb @@ -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 diff --git a/lib/gitlab/ssh_public_key.rb b/lib/gitlab/ssh_public_key.rb index 47571239b5c..6df54852d02 100644 --- a/lib/gitlab/ssh_public_key.rb +++ b/lib/gitlab/ssh_public_key.rb @@ -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) |