Skip to content

Commit

Permalink
Merge pull request #695 from Shopify/unsafe-load-file
Browse files Browse the repository at this point in the history
Unconditionally call `YAML.unsafe_load_file`
  • Loading branch information
rafaelfranca authored Feb 21, 2025
2 parents f2b6761 + b683be5 commit f2b5f58
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions test/config_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ def test_config_is_sorted_alphabetically
def test_no_cops_are_configured_as_pending
pending_cops = []

load_method = YAML.respond_to?(:unsafe_load_file) ? :unsafe_load_file : :load_file
YAML.public_send(load_method, FULL_CONFIG_PATH).each do |cop_name, cop_config|
YAML.unsafe_load_file(FULL_CONFIG_PATH).each do |cop_name, cop_config|
pending_cops << cop_name if Hash === cop_config && cop_config["Enabled"] == "pending"
end

Expand Down

0 comments on commit f2b5f58

Please sign in to comment.