Skip to content

Commit edafbf3

Browse files
authored
QUA-619: remove safe_yaml gem (#320)
1 parent aceff1d commit edafbf3

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ gem "rubocop-sequel", require: false
1818
gem "rubocop-shopify", require: false
1919
gem "rubocop-sorbet", require: false
2020
gem "rubocop-thread_safety", require: false
21-
gem "safe_yaml"
2221
gem "test-prof", require: false
2322

2423
group :test do

Gemfile.lock

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ GEM
7777
rubocop-thread_safety (0.4.4)
7878
rubocop (>= 0.53.0)
7979
ruby-progressbar (1.11.0)
80-
safe_yaml (1.0.5)
8180
test-prof (1.0.9)
8281
tzinfo (2.0.4)
8382
concurrent-ruby (~> 1.0)
@@ -105,7 +104,6 @@ DEPENDENCIES
105104
rubocop-shopify
106105
rubocop-sorbet
107106
rubocop-thread_safety
108-
safe_yaml
109107
test-prof
110108

111109
BUNDLED WITH

lib/cc/engine/issue.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
# frozen_string_literal: true
22

3-
require "safe_yaml"
43
require "cc/engine/content_resolver"
54

6-
SafeYAML::OPTIONS[:default_mode] = :safe
7-
85
module CC
96
module Engine
107
class Issue < SimpleDelegator
@@ -71,7 +68,11 @@ def cop_definition
7168
end
7269

7370
def cop_list
74-
@cop_list ||= YAML.load_file(expand_config_path("cops.yml"))
71+
@cop_list ||= yaml_safe_load(expand_config_path("cops.yml"))
72+
end
73+
74+
def yaml_safe_load(path)
75+
YAML.safe_load(File.read(path))
7576
end
7677

7778
def expand_config_path(path)

0 commit comments

Comments
 (0)