Browse Source

Add pre-commit config

master
Gabriel Augendre 3 months ago
parent
commit
64c58260d9
  1. 34
      .pre-commit-config.yaml
  2. 8
      pyproject.toml

34
.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]

8
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"

Loading…
Cancel
Save