mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-12-23 03:31:07 +00:00
enable strict mode by default for mypy
This commit is contained in:
parent
98a975550a
commit
a2b96d03dc
8
dev.py
8
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)
|
||||
|
||||
|
|
|
@ -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]]
|
||||
|
|
Loading…
Reference in a new issue