diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index f03eff6..00e4f41 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -56,3 +56,23 @@ jobs: - name: Attempt docs build working-directory: ./docs run: make html + + precommit_hooks: + runs-on: ubuntu-latest + strategy: + matrix: + cmd: + - "end-of-file-fixer" + - "trailing-whitespace" + - "mixed-line-ending" + steps: + - uses: actions/checkout@v4 + + - name: Set up Python 3.12 + uses: actions/setup-python@v5 + with: + python-version: 3.12 + + - uses: pre-commit/action@v3.0.1 + with: + extra_args: ${{ matrix.cmd }} --all-files diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f6809de..59baf68 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 # pre-commit-hooks version + rev: v5.0.0 # pre-commit-hooks version hooks: - id: check-added-large-files - id: detect-private-key @@ -9,10 +9,12 @@ repos: - id: check-merge-conflict - id: detect-aws-credentials args: [ --allow-missing-credentials ] + - id: mixed-line-ending + args: [ --fix=lf ] - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.5.0 hooks: - id: ruff-format - id: ruff args: [ --fix, --exit-non-zero-on-fix ] -minimum_pre_commit_version: 3.7.1 +minimum_pre_commit_version: 4.0.1 diff --git a/docs/make.bat b/docs/make.bat index 7d65db3..dc1312a 100644 --- a/docs/make.bat +++ b/docs/make.bat @@ -1,35 +1,35 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=source -set BUILDDIR=build - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.https://www.sphinx-doc.org/ - exit /b 1 -) - -if "%1" == "" goto help - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% - -:end +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=source +set BUILDDIR=build + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end popd diff --git a/pyproject.toml b/pyproject.toml index 112d968..4a536b8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,13 @@ dependencies = [ dynamic = ["version"] [project.optional-dependencies] -dev = ["pre-commit>=3.7.1", "ipython", "ipykernel", "psycopg2-binary", "ruff==0.5.0"] +dev = [ + "pre-commit>=4.0.1", + "ipython", + "ipykernel", + "psycopg2-binary", + "ruff==0.5.0" +] tests = ["pytest", "pytest-cov", "pytest-asyncio==0.18.3", "mock"] docs = [ "sphinx==6.1.3",