From c3e438379ae369cd00e19c6ca388af1d15e59aea Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Tue, 3 Jul 2018 05:12:36 -0700 Subject: [PATCH] Appease yaml.load linters _technically_ yaml.load is unsafe, however the contents being loaded here are previously loaded just above using a safe loader so this is not an abitrary code vector. Fixing it nonetheless :) --- pre_commit/commands/migrate_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pre_commit/commands/migrate_config.py b/pre_commit/commands/migrate_config.py index 193a002b..b43367fb 100644 --- a/pre_commit/commands/migrate_config.py +++ b/pre_commit/commands/migrate_config.py @@ -32,7 +32,7 @@ def _migrate_map(contents): # will yield a valid configuration try: trial_contents = header + 'repos:\n' + rest - yaml.load(trial_contents) + ordered_load(trial_contents) contents = trial_contents except yaml.YAMLError: contents = header + 'repos:\n' + _indent(rest)