Skip to content

Commit cb4807b

Browse files
committed
Add type hinting.
1 parent 6452e12 commit cb4807b

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

run_mypy.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import subprocess
22
import sys
3-
modules = ["axelrod/actions.py",
3+
modules = ["run_strategy_indexer.py",
4+
"axelrod/actions.py",
45
"axelrod/deterministic_cache.py",
56
"axelrod/ecosystem.py",
67
"axelrod/game.py",

run_strategy_indexer.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import sys
77
import os
88

9-
def read_index(index_path):
9+
def read_index(index_path: str) -> str:
1010
"""
1111
Read the index of strategies
1212
@@ -24,7 +24,7 @@ def read_index(index_path):
2424
strategies_reference = f.read()
2525
return strategies_reference
2626

27-
def get_module_name(module_path):
27+
def get_module_name(module_path: str) -> str:
2828
"""
2929
Take string of the form `./axelrod/strategies/titfortat.py` and returns
3030
`titfortat`.
@@ -43,9 +43,10 @@ def get_module_name(module_path):
4343
module_name = os.path.splitext(filename)[0]
4444
return module_name
4545

46-
def check_module(module_path,
47-
index_path="./docs/reference/all_strategies.rst",
48-
excluded=("_strategies", "__init__", "_filters", "human")):
46+
def check_module(module_path: str,
47+
index_path: str="./docs/reference/all_strategies.rst",
48+
excluded: tuple=("_strategies", "__init__",
49+
"_filters", "human")) -> bool:
4950
"""
5051
Check if a module name is written in the index of strategies.
5152

0 commit comments

Comments
 (0)