Commit a99cfe85 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'fix-json-double-load' into 'master'

Exclude lib/gitlab/danger from JSON cop

Closes #217335

See merge request gitlab-org/gitlab!32534
parents ca34500c 69ec4838
...@@ -225,6 +225,7 @@ Gitlab/Json: ...@@ -225,6 +225,7 @@ Gitlab/Json:
- 'scripts/**/*' - 'scripts/**/*'
- 'lib/rspec_flaky/**/*' - 'lib/rspec_flaky/**/*'
- 'lib/quality/**/*' - 'lib/quality/**/*'
- 'lib/gitlab/danger/**/*'
GitlabSecurity/PublicSend: GitlabSecurity/PublicSend:
Enabled: true Enabled: true
......
# frozen_string_literal: true # frozen_string_literal: true
require_relative '../json' require 'json'
module Gitlab module Gitlab
module Danger module Danger
...@@ -25,8 +25,8 @@ module Gitlab ...@@ -25,8 +25,8 @@ module Gitlab
)}x.freeze )}x.freeze
def initialize def initialize
names = Gitlab::Json.parse(File.read(DIGESTS)).keys + names = JSON.parse(File.read(DIGESTS)).keys +
Gitlab::Json.parse(File.read(ALIASES)).keys JSON.parse(File.read(ALIASES)).keys
@emoji = names.map { |name| ":#{name}:" } @emoji = names.map { |name| ":#{name}:" }
end end
......
...@@ -16,7 +16,7 @@ module Gitlab ...@@ -16,7 +16,7 @@ module Gitlab
raise HTTPError, "Failed to read #{url}: #{rsp.code} #{rsp.message}" raise HTTPError, "Failed to read #{url}: #{rsp.code} #{rsp.message}"
end end
Gitlab::Json.parse(rsp.body) JSON.parse(rsp.body)
end end
end end
end end
......
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