From 182ffe776a00b56a6f471710a00733bcf5f6ecd5 Mon Sep 17 00:00:00 2001 From: Adam Sachs Date: Wed, 3 Jul 2024 14:40:16 -0400 Subject: [PATCH] ensure format and sort checks are run on CI (#5057) --- .github/workflows/backend_checks.yml | 4 ++-- noxfiles/ci_nox.py | 8 ++++---- noxfiles/setup_tests_nox.py | 3 ++- pyproject.toml | 1 + 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/backend_checks.yml b/.github/workflows/backend_checks.yml index 252694b14a..c5a5c63270 100644 --- a/.github/workflows/backend_checks.yml +++ b/.github/workflows/backend_checks.yml @@ -79,8 +79,8 @@ jobs: matrix: session_name: [ - "isort", - "black", + '"isort(check)"', + '"black(check)"', "mypy", "pylint", "xenon", diff --git a/noxfiles/ci_nox.py b/noxfiles/ci_nox.py index fe2d0c0822..eee10f3acd 100644 --- a/noxfiles/ci_nox.py +++ b/noxfiles/ci_nox.py @@ -24,8 +24,8 @@ @nox.session() def static_checks(session: nox.Session) -> None: """Run the static checks only.""" - session.notify("black") - session.notify("isort") + session.notify("black(fix)") + session.notify("isort(fix)") session.notify("xenon") session.notify("mypy") session.notify("pylint") @@ -35,8 +35,8 @@ def static_checks(session: nox.Session) -> None: @nox.parametrize( "mode", [ - nox.param("fix", id="fix"), nox.param("check", id="check"), + nox.param("fix", id="fix"), ], ) def black(session: nox.Session, mode: str) -> None: @@ -52,8 +52,8 @@ def black(session: nox.Session, mode: str) -> None: @nox.parametrize( "mode", [ - nox.param("fix", id="fix"), nox.param("check", id="check"), + nox.param("fix", id="fix"), ], ) def isort(session: nox.Session, mode: str) -> None: diff --git a/noxfiles/setup_tests_nox.py b/noxfiles/setup_tests_nox.py index ddae0f46dd..63c1ea0a16 100644 --- a/noxfiles/setup_tests_nox.py +++ b/noxfiles/setup_tests_nox.py @@ -1,5 +1,7 @@ from typing import Optional +from nox import Session + from constants_nox import ( CI_ARGS_EXEC, COMPOSE_FILE, @@ -11,7 +13,6 @@ START_APP, START_APP_WITH_EXTERNAL_POSTGRES, ) -from nox import Session from run_infrastructure import API_TEST_DIR, OPS_TEST_DIR, run_infrastructure diff --git a/pyproject.toml b/pyproject.toml index 10d2bb9f0b..9d2f4885fd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -103,6 +103,7 @@ exclude = ''' ########### [tool.isort] known_first_party = ["versioneer"] +known_third_party = ["nox"] profile = "black" line_length = 88 src_paths = ["src", "tests", "noxfiles"]