mypy: Turn on return value checks

Its a shame GvR is married to "return None"
https://github.com/python/mypy/issues/7511
This commit is contained in:
Kovid Goyal
2021-10-26 22:39:14 +05:30
parent 5cb36a4632
commit 4494ddd8ff
52 changed files with 124 additions and 49 deletions

View File

@@ -61,7 +61,7 @@ def setup_bash_integration() -> None:
setup_integration('bash', os.path.expanduser('~/.bashrc'))
def atomic_symlink(destination: str, in_directory: str) -> str:
def atomic_symlink(destination: str, in_directory: str) -> None:
os.makedirs(in_directory, exist_ok=True)
name = os.path.basename(destination)
tmpname = os.path.join(in_directory, f'{name}-{os.getpid()}-{time.monotonic()}')
@@ -97,6 +97,7 @@ def get_supported_shell_name(path: str) -> Optional[str]:
name = os.path.basename(path).split('.')[0].lower()
if name in SUPPORTED_SHELLS:
return name
return None
@run_once