From 64c58260d96ef7caf55a486e3df0bf744fbb8fb7 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Sat, 10 Jul 2021 12:10:49 +0200 Subject: [PATCH] Add pre-commit config --- .pre-commit-config.yaml | 34 ++++++++++++++++++++++++++++++++++ pyproject.toml | 8 ++++++++ 2 files changed, 42 insertions(+) create mode 100755 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100755 index 0000000..ee3b073 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,34 @@ +exclude: \.min\.(js|css)$|/generated/ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.4.0 + hooks: + - id: check-ast + types: [python] + - id: check-json + types: [json] + - id: check-toml + types: [toml] + - id: check-xml + types: [xml] + - id: check-yaml + types: [yaml] + - id: end-of-file-fixer + - id: check-merge-conflict + - id: pretty-format-json + args: + - --autofix + - --no-sort-keys + - id: trailing-whitespace + args: + - --markdown-linebreak-ext=md + - repo: https://github.com/timothycrosley/isort + rev: 5.8.0 + hooks: + - id: isort + types: [python] + - repo: https://github.com/psf/black + rev: 20.8b1 + hooks: + - id: black + types: [python] diff --git a/pyproject.toml b/pyproject.toml index d8360b0..7d54401 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,15 @@ django-environ-2 = "^2.1.0" [tool.poetry.dev-dependencies] django-debug-toolbar = "^3.2.1" django-dotenv = "^1.4.2" +pre-commit = "^2.13.0" +pytest = "^6.2.4" [build-system] requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" + +[tool.black] +target-version = ['py38'] + +[tool.isort] +profile = "black"