summaryrefslogtreecommitdiffstats
path: root/pre_commit/commands/migrate_config.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2020-06-14 09:11:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2020-06-14 09:11:24 +0000
commit1312af87e5908ac252c0659a60216e96ec5b23bd (patch)
tree7621ad7267ffb9ecd8339983fd83150abc99082f /pre_commit/commands/migrate_config.py
parentReleasing debian version 2.3.0-1. (diff)
downloadpre-commit-1312af87e5908ac252c0659a60216e96ec5b23bd.tar.xz
pre-commit-1312af87e5908ac252c0659a60216e96ec5b23bd.zip
Merging upstream version 2.5.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'pre_commit/commands/migrate_config.py')
-rw-r--r--pre_commit/commands/migrate_config.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/pre_commit/commands/migrate_config.py b/pre_commit/commands/migrate_config.py
index d83b8e9..d580ff1 100644
--- a/pre_commit/commands/migrate_config.py
+++ b/pre_commit/commands/migrate_config.py
@@ -2,6 +2,7 @@ import re
import yaml
+from pre_commit.clientlib import load_config
from pre_commit.util import yaml_load
@@ -43,6 +44,9 @@ def _migrate_sha_to_rev(contents: str) -> str:
def migrate_config(config_file: str, quiet: bool = False) -> int:
+ # ensure that the configuration is a valid pre-commit configuration
+ load_config(config_file)
+
with open(config_file) as f:
orig_contents = contents = f.read()