From eed57cda3abd09e7ad9dd309801abd7bc2507334 Mon Sep 17 00:00:00 2001 From: jorenham Date: Tue, 8 Oct 2024 16:35:03 +0200 Subject: [PATCH] configure pre-commit --- .pre-commit-config.yaml | 70 +++++++++++++++++++++++++++++++++++++++++ pyproject.toml | 1 + 2 files changed, 71 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..113b6ee3 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,70 @@ +ci: + autoupdate_branch: "master" + autoupdate_commit_msg: "update pre-commit hooks" + skip: + - markdownlint + - ruff + - ruff-format + - verifytypes + - typetest + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: check-added-large-files + - id: check-ast + - id: check-case-conflict + - id: check-docstring-first + - id: check-executables-have-shebangs + - id: check-illegal-windows-names + - 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-aws-credentials + args: [--allow-missing-credentials] + - id: detect-private-key + - id: fix-byte-order-marker + - id: forbid-submodules + - id: name-tests-test + args: [--pytest-test-first] + - id: no-commit-to-branch + args: [--branch, master] + - id: trailing-whitespace + args: [--markdown-linebreak-ext=md] + + - repo: https://github.com/igorshubovych/markdownlint-cli + rev: v0.42.0 + hooks: + - id: markdownlint + + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.6.9 + hooks: + - id: ruff + args: [--fix, --show-fixes] + types_or: [python, pyi] + - id: ruff-format + types_or: [python, pyi] + + - repo: local + hooks: + - id: verifytypes + name: poe verifytypes + entry: poe verifytypes + language: system + always_run: true + pass_filenames: false + - id: typetest + name: poe typetest + entry: poe typetest + language: system + always_run: true + pass_filenames: false diff --git a/pyproject.toml b/pyproject.toml index 8edf3444..1fcc6cd6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,6 +56,7 @@ rm -rf lint = "ruff check" format = "ruff format" +pre-commit = "pre-commit run --all-files" _typetest_bpr = "basedpyright typetests" _typetest_mypy = "mypy --config-file=pyproject.toml typetests"