mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-22 14:38:00 +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')
|
@cli.command('lint')
|
||||||
@click.argument('path', required = False, type = Path, default = REPO.joinpath('relay'))
|
@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,
|
@click.option('--watch', '-w', is_flag = True,
|
||||||
help = 'Automatically, re-run the linters on source change')
|
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()
|
path = path.expanduser().resolve()
|
||||||
|
|
||||||
if watch:
|
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
|
return
|
||||||
|
|
||||||
flake8 = [sys.executable, '-m', 'flake8', "dev.py", str(path)]
|
flake8 = [sys.executable, '-m', 'flake8', "dev.py", str(path)]
|
||||||
mypy = [sys.executable, '-m', 'mypy', "dev.py", str(path)]
|
mypy = [sys.executable, '-m', 'mypy', "dev.py", str(path)]
|
||||||
|
|
||||||
if strict:
|
|
||||||
mypy.append('--strict')
|
|
||||||
|
|
||||||
click.echo('----- flake8 -----')
|
click.echo('----- flake8 -----')
|
||||||
subprocess.run(flake8)
|
subprocess.run(flake8)
|
||||||
|
|
||||||
|
|
|
@ -89,6 +89,7 @@ warn_unreachable = true
|
||||||
warn_unused_ignores = true
|
warn_unused_ignores = true
|
||||||
ignore_missing_imports = true
|
ignore_missing_imports = true
|
||||||
implicit_reexport = true
|
implicit_reexport = true
|
||||||
|
strict = true
|
||||||
follow_imports = "silent"
|
follow_imports = "silent"
|
||||||
|
|
||||||
[[tool.mypy.overrides]]
|
[[tool.mypy.overrides]]
|
||||||
|
|
Loading…
Reference in a new issue