From bea9175f06e705b61b35fe257e882bd246b7cb72 Mon Sep 17 00:00:00 2001 From: Tobias Sterbak Date: Wed, 7 Feb 2024 08:31:10 +0000 Subject: [PATCH] Add pre-commit hooks --- .pre-commit-config.yaml | 32 ++++++++++++++++++++++++++++++++ Makefile | 1 + 2 files changed, 33 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..11c48e64 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,32 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.2.0 + hooks: + - id: check-added-large-files + - id: check-ast + - id: check-merge-conflict + - id: check-yaml + - id: detect-private-key + - id: end-of-file-fixer + - id: trailing-whitespace + +- repo: https://github.com/asottile/reorder_python_imports + rev: v3.9.0 + hooks: + - id: reorder-python-imports + +- repo: https://github.com/psf/black + rev: 22.10.0 + hooks: + - id: black + language_version: python3.10 + +- repo: https://github.com/python-poetry/poetry + rev: 1.6.1 + hooks: + - id: poetry-check + #- id: poetry-lock + - id: poetry-export + #- id: poetry-install diff --git a/Makefile b/Makefile index 93f0e1a5..5e069da9 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,7 @@ poetry: install: poetry install poetry run python scripts/download-tools.py + poetry run pre-commit install export: poetry export -f requirements.txt --output requirements.txt