-
Notifications
You must be signed in to change notification settings - Fork 2
/
.pre-commit-config.yaml
61 lines (61 loc) · 1.8 KB
/
.pre-commit-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
exclude: "^package.json|^package-lock.json"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
# syntax
- id: check-yaml
- id: check-json
- id: check-toml
- id: check-xml
- id: pretty-format-json
args: ["--autofix"]
# git & filesystem
- id: check-added-large-files
- id: check-symlinks
- id: detect-private-key
- id: check-merge-conflict
- id: check-case-conflict # file conflicts: a.txt vs. A.txt
# formatters
- id: mixed-line-ending
- id: trailing-whitespace
exclude: "(.*\\.html|.*\\.md)$"
- id: end-of-file-fixer
exclude: "(.*\\.xml|.*\\.svg)$"
# python
- id: check-ast # abstract syntax tree
- id: check-builtin-literals # no {} and [], but dict() and list()
- id: debug-statements
# - id: name-tests-test
# args: [--pytest-test-first]
# django-upgrade suggestions
- repo: https://github.com/adamchainz/django-upgrade
rev: "1.14.0"
hooks:
- id: django-upgrade
args: [--target-version, "4.2"]
# tha black
- repo: https://github.com/psf/black-pre-commit-mirror
rev: "23.7.0"
hooks:
- id: black
# flake8 replacement (&more)
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.284"
hooks:
- id: ruff
args: [--fix]
# js/sass/etc formatter
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.2
hooks:
- id: prettier
args: [--list-different]
exclude: "(.*\\.html|.*\\.md)$"
# eslinth, shall we? urrfff
# - repo: https://github.com/pre-commit/mirrors-eslint
# rev: v8.47.0
# hooks:
# - id: eslint