From 12b9ee317a434d72f1f8d2a3036e623c53d89590 Mon Sep 17 00:00:00 2001 From: Izalia Mae Date: Mon, 1 Apr 2024 13:05:32 -0400 Subject: [PATCH] simplify dev lint command with watch flag --- relay/dev.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/relay/dev.py b/relay/dev.py index e4c4809..7ab0a4f 100644 --- a/relay/dev.py +++ b/relay/dev.py @@ -53,16 +53,17 @@ def cli_install(): help = 'Automatically, re-run the linters on source change') def cli_lint(path: Path, strict: bool, watch: bool) -> None: path = path.expanduser().resolve() + + if watch: + handle_run_watcher([sys.executable, "-m", "relay.dev", "lint", str(path)], wait = True) + return + flake8 = [sys.executable, '-m', 'flake8', str(path)] mypy = [sys.executable, '-m', 'mypy', str(path)] if strict: mypy.append('--strict') - if watch: - handle_run_watcher(mypy, flake8, wait = True) - return - click.echo('----- flake8 -----') subprocess.run(flake8)