Commit da6e2ae8 authored by Robert May's avatar Robert May

Exclude lib/gitlab/danger from JSON cop

These files are prone to double-loading but also don't include
the Rails environment, causing warnings around constants.
parent 1d35e510
...@@ -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
......
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