From: Daniele Varrazzo Date: Fri, 27 Dec 2024 01:48:20 +0000 (+0100) Subject: ci: add pre-commit configuration X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c58b2025f88f3300e757e1aa5bc009d0e45f1c16;p=thirdparty%2Fpsycopg.git ci: add pre-commit configuration --- diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..06cacf82d --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,26 @@ +# See https://pre-commit.com for more information +repos: + - repo: local + hooks: + - id: black + name: black + language: system + entry: black --check --diff + files: \.py[i]?$ + + - id: codespell + name: codespell + language: system + entry: codespell + + - id: flake8 + name: flake8 + language: system + entry: flake8 + files: \.py$ + + - id: mypy + name: mypy + language: system + entry: mypy --pretty + files: \.py[i]?$ diff --git a/psycopg/pyproject.toml b/psycopg/pyproject.toml index 594a3af8c..a5df9b80b 100644 --- a/psycopg/pyproject.toml +++ b/psycopg/pyproject.toml @@ -84,6 +84,7 @@ dev = [ "dnspython >= 2.1", "flake8 >= 4.0", "mypy >= 1.14", + "pre-commit >= 4.0.1", "types-setuptools >= 57.4", "wheel >= 0.37", ]