diff --git a/.github/workflows/prek.yaml b/.github/workflows/prek.yaml new file mode 100644 index 00000000..c1985918 --- /dev/null +++ b/.github/workflows/prek.yaml @@ -0,0 +1,9 @@ +name: Prek checks +on: [push, pull_request] + +jobs: + prek: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: j178/prek-action@v2 diff --git a/docs/contribute.md b/docs/contribute.md index f3444435..f0565632 100644 --- a/docs/contribute.md +++ b/docs/contribute.md @@ -22,7 +22,7 @@ One of the best ways is follow [maturin offical documentation](https://www.matur ```bash > python3 -m venv .venv > source .venv/bin/activate -> pip install -U pip maturin pre-commit pytest pytest-anyio pydantic pgpq +> pip install -U pip maturin prek pytest pytest-anyio pydantic pgpq ``` Then you need to build `PSQLPy` project. @@ -33,12 +33,12 @@ maturin develop After this step project is built and installed in your python environment you created in previous step. ## Linting and type checking -We have pre-commit configured with all our settings. We highly recommend you to install it as a git hook using pre-commit install command. +We have prek configured with all our settings. We highly recommend you to install it as a git hook using prek install command. But even without installation, you can run all lints manually: ```bash -pre-commit run -a +prek run -a ``` ## Testing diff --git a/psqlpy-stress/pyproject.toml b/psqlpy-stress/pyproject.toml index d94f882c..9d78be05 100644 --- a/psqlpy-stress/pyproject.toml +++ b/psqlpy-stress/pyproject.toml @@ -26,7 +26,7 @@ piccolo = "^1.12.0" [tool.poetry.group.dev.dependencies] -pre-commit = "*" +prek = "*" mypy = "*" ruff = "*"