From 91f9fb14a59398cf8bb073c2d4dfe3aa4da1def5 Mon Sep 17 00:00:00 2001 From: Maximilian Schulz Date: Mon, 30 Oct 2023 13:14:39 +0100 Subject: [PATCH] use subprocess for linting --- vizro-core/hatch.toml | 2 +- vizro-core/schemas/generate.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/vizro-core/hatch.toml b/vizro-core/hatch.toml index 4ff53c16c..c2c7b0350 100644 --- a/vizro-core/hatch.toml +++ b/vizro-core/hatch.toml @@ -53,7 +53,7 @@ prep-release = [ 'echo "Now raise a PR to merge into main with title: Release of vizro-core $(hatch version)"' ] pypath = "python -c 'import sys; print(sys.executable)'" -schema = ["python schemas/generate.py {args}", "lint"] +schema = "python schemas/generate.py {args}" secrets = "pre-commit run gitleaks --all-files" test = [ "test-unit", diff --git a/vizro-core/schemas/generate.py b/vizro-core/schemas/generate.py index e0bd86a63..c7b9ad381 100644 --- a/vizro-core/schemas/generate.py +++ b/vizro-core/schemas/generate.py @@ -1,6 +1,7 @@ """Script to generate JSON schema. For more information, run `hatch run schema --help`.""" import argparse import json +import subprocess import sys from pathlib import Path @@ -21,3 +22,4 @@ print("JSON schema is up to date.") # noqa: T201 else: schema_path.write_text(schema_json) + subprocess.run("hatch run lint", shell=True, stdout=subprocess.DEVNULL) # nosec