mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-05-08 00:09:15 -05:00
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 :)
This commit is contained in:
@@ -32,7 +32,7 @@ def _migrate_map(contents):
|
|||||||
# will yield a valid configuration
|
# will yield a valid configuration
|
||||||
try:
|
try:
|
||||||
trial_contents = header + 'repos:\n' + rest
|
trial_contents = header + 'repos:\n' + rest
|
||||||
yaml.load(trial_contents)
|
ordered_load(trial_contents)
|
||||||
contents = trial_contents
|
contents = trial_contents
|
||||||
except yaml.YAMLError:
|
except yaml.YAMLError:
|
||||||
contents = header + 'repos:\n' + _indent(rest)
|
contents = header + 'repos:\n' + _indent(rest)
|
||||||
|
|||||||
Reference in New Issue
Block a user