From b71df776a437e89d939b5855e1d338cf27739afd Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 9 Sep 2025 07:23:03 +0200 Subject: [PATCH] Add pre-commit --- .github/workflows/main.yml | 9 ++++++ .pre-commit-config.yaml | 61 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8e6f330b..a18e6d83 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,6 +11,15 @@ on: - '*' jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - uses: actions/setup-python@v6 + with: + python-version: 3.x + - uses: pre-commit/action@v3.0.1 + ubuntu22: name: Ubuntu 22.04 x86_64 runs-on: ubuntu-22.04 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..be18c8e0 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,61 @@ +# Learn more about this config here: https://pre-commit.com/ + +# To enable these pre-commit hooks run `uvx pre-commit install` +# or `pipx install pre-commit` or `brew install pre-commit`, etc. +# Then in the project root directory run `pre-commit install` + +repos: + # - repo: https://github.com/pre-commit/pre-commit-hooks + # rev: v6.0.0 + # hooks: + # - id: check-added-large-files + # - id: check-ast + # - id: check-builtin-literals + # - id: check-case-conflict + # - id: check-docstring-first + # - id: check-executables-have-shebangs + # - id: check-json + # - id: check-merge-conflict + # - id: check-shebang-scripts-are-executable + # - id: check-symlinks + # - id: check-toml + # - id: check-vcs-permalinks + # - id: check-xml + # - id: check-yaml + # - id: debug-statements + # - id: destroyed-symlinks + # - id: detect-private-key + # - id: end-of-file-fixer + # - id: file-contents-sorter + # - id: fix-byte-order-marker + # - id: forbid-new-submodules + # - id: forbid-submodules + # - id: mixed-line-ending + # - id: requirements-txt-fixer + # - id: sort-simple-yaml + # - id: trailing-whitespace + + - repo: https://github.com/codespell-project/codespell + rev: v2.4.1 + hooks: + - id: codespell # See pyproject.toml for args + args: + - --ignore-words-list=inbetween,ned,positionned,prefere,standart + additional_dependencies: + - tomli + + # - repo: https://github.com/astral-sh/ruff-pre-commit + # rev: v0.12.10 + # hooks: + # # - id: ruff-check + # - id: ruff-format + + - repo: https://github.com/tox-dev/pyproject-fmt + rev: v2.6.0 + hooks: + - id: pyproject-fmt + + - repo: https://github.com/abravalheri/validate-pyproject + rev: v0.24.1 + hooks: + - id: validate-pyproject