From bbf13d8591deb58cd4e2bc14bef580eebdf7ec4a Mon Sep 17 00:00:00 2001 From: object-Object Date: Sun, 5 Nov 2023 14:14:28 -0500 Subject: [PATCH] Run pre-commit in Nox --- .pre-commit-config.yaml | 1 + noxfile.py | 4 ++-- pyproject.toml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 205a0351..58027a6c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,3 +16,4 @@ repos: rev: v1.1.334 hooks: - id: pyright + args: ["--warnings"] diff --git a/noxfile.py b/noxfile.py index 83a602da..129d9683 100644 --- a/noxfile.py +++ b/noxfile.py @@ -1,11 +1,11 @@ import nox -@nox.session +@nox.session(reuse_venv=True) def tests(session: nox.Session): session.install("-e", ".[test]", "-e", "./test/_submodules/HexMod") - session.run("pyright", "src/hexdoc", "--warnings") + session.run("pre-commit") # test cookiecutter last so the extra package install doesn't interfere session.run("pytest", *session.posargs) diff --git a/pyproject.toml b/pyproject.toml index 83027096..5a63c7cc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -66,13 +66,13 @@ test = [ "pytest-cookies~=0.7", "pytest-dependency~=0.5", "syrupy~=4.6", + "pre-commit", ] dev = [ "hexdoc[pdoc,test]", "ruff==0.1.4", "hatch", "nox", - "pre-commit", ] [project.urls]