From a2b96d03dc9bd8206a1ff238e55c9554898878da Mon Sep 17 00:00:00 2001 From: Izalia Mae Date: Fri, 14 Jun 2024 13:37:19 -0400 Subject: [PATCH] enable strict mode by default for mypy --- dev.py | 8 ++------ pyproject.toml | 1 + 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/dev.py b/dev.py index 96754fa..a6669fb 100755 --- a/dev.py +++ b/dev.py @@ -50,22 +50,18 @@ def cli_install(no_dev: bool) -> None: @cli.command('lint') @click.argument('path', required = False, type = Path, default = REPO.joinpath('relay')) -@click.option('--strict', '-s', is_flag = True, help = 'Enable strict mode for mypy') @click.option('--watch', '-w', is_flag = True, help = 'Automatically, re-run the linters on source change') -def cli_lint(path: Path, strict: bool, watch: bool) -> None: +def cli_lint(path: Path, watch: bool) -> None: path = path.expanduser().resolve() if watch: - handle_run_watcher([sys.executable, "-m", "relay.dev", "lint", str(path)], wait = True) + handle_run_watcher([sys.executable, "dev.py", "lint", str(path)], wait = True) return flake8 = [sys.executable, '-m', 'flake8', "dev.py", str(path)] mypy = [sys.executable, '-m', 'mypy', "dev.py", str(path)] - if strict: - mypy.append('--strict') - click.echo('----- flake8 -----') subprocess.run(flake8) diff --git a/pyproject.toml b/pyproject.toml index caf869b..dd6dc6b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -89,6 +89,7 @@ warn_unreachable = true warn_unused_ignores = true ignore_missing_imports = true implicit_reexport = true +strict = true follow_imports = "silent" [[tool.mypy.overrides]]