diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dde6a57..0b2fb37 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,7 +28,11 @@ jobs: python-version: 3.11 - name: install requirements - run: python -m pip install nox + run: python -m pip install nox pre-commit + + - name: run pre-commit + if: ${{ matrix.os == 'ubuntu-latest' }} + run: pre-commit run --all --show-diff-on-failure - name: run tests run: nox diff --git a/noxfile.py b/noxfile.py index 4d28f0c..e6d8125 100644 --- a/noxfile.py +++ b/noxfile.py @@ -11,42 +11,6 @@ EDITABLE_TESTS = False -@nox.session -def format(session): - """ - Autoformat source files. - - If argument check is given, only reports changes. - """ - session.install("-e", ".[format]") - check = "check" in session.posargs - - autoflake_args = [ - "--in-place", - "--imports=fillname", - "--ignore-init-module-imports", - "--remove-unused-variables", - "-r", - "src", - "tests", - ] - if check: - autoflake_args.remove("--in-place") - session.run("autoflake", *autoflake_args) - - isort_args = ["--profile", "black", "src", "tests"] - if check: - isort_args.insert(0, "--check") - isort_args.insert(1, "--diff") - session.run("isort", *isort_args) - - black_args = ["src", "tests"] - if check: - black_args.insert(0, "--check") - black_args.insert(1, "--diff") - session.run("black", *black_args) - - @nox.session def doc(session): """