We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5c075a3 commit 46614d8Copy full SHA for 46614d8
src/vcspull/validator.py
@@ -1,3 +1,4 @@
1
+import pathlib
2
import typing as t
3
4
from vcspull.types import RawConfigDict
@@ -7,4 +8,25 @@
7
8
9
10
def is_valid_config(config: t.Dict[str, t.Any]) -> "TypeGuard[RawConfigDict]":
11
+ if not isinstance(config, dict):
12
+ return False
13
+
14
+ for k, v in config.items():
15
+ if k is None or v is None:
16
17
18
+ if not isinstance(k, str) and not isinstance(k, pathlib.Path):
19
20
21
+ if not isinstance(v, dict):
22
23
24
+ for repo_name, repo in v.items():
25
+ if not isinstance(repo, (str, dict, pathlib.Path)):
26
27
28
+ if isinstance(repo, dict):
29
+ if "url" not in repo and "repo" not in repo:
30
31
32
return True
0 commit comments