aboutsummaryrefslogtreecommitdiff
path: root/contrib/devtools/circular-dependencies.py
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2020-11-22 11:32:55 +0800
committerfanquake <fanquake@gmail.com>2020-12-28 14:25:06 +0800
commit1ef2138c0db3bd4f9332c777fa3fb2770dc1b08c (patch)
tree3faeca0a36f00c9aa46afe4c7e4495d1955ba576 /contrib/devtools/circular-dependencies.py
parent4a8f4ac4fc07c59a0bfdbb7c15a50cf5b4364312 (diff)
lint: run mypy over contrib/devtools
Diffstat (limited to 'contrib/devtools/circular-dependencies.py')
-rwxr-xr-xcontrib/devtools/circular-dependencies.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/contrib/devtools/circular-dependencies.py b/contrib/devtools/circular-dependencies.py
index bc5f09a3e2..6dc4e83ee7 100755
--- a/contrib/devtools/circular-dependencies.py
+++ b/contrib/devtools/circular-dependencies.py
@@ -5,6 +5,7 @@
import sys
import re
+from typing import Dict, List, Set
MAPPING = {
'core_read.cpp': 'core_io.cpp',
@@ -32,7 +33,7 @@ def module_name(path):
return None
files = dict()
-deps = dict()
+deps: Dict[str, Set[str]] = dict()
RE = re.compile("^#include <(.*)>")
@@ -59,12 +60,12 @@ for arg in sorted(files.keys()):
deps[module].add(included_module)
# Loop to find the shortest (remaining) circular dependency
-have_cycle = False
+have_cycle: bool = False
while True:
shortest_cycle = None
for module in sorted(deps.keys()):
# Build the transitive closure of dependencies of module
- closure = dict()
+ closure: Dict[str, List[str]] = dict()
for dep in deps[module]:
closure[dep] = []
while True: