forked from copier-org/copier
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
87 lines (80 loc) · 2.29 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
default_language_version:
python: python3
default_stages:
- commit
repos:
# commit messages
- repo: https://github.com/commitizen-tools/commitizen
rev: v2.17.0
hooks:
- id: commitizen
stages: [commit-msg]
# checking our hooks themselves
- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes
# hooks running from local virtual environment
- repo: local
hooks:
- id: autoflake
name: autoflake
entry: poetry run autoflake
language: system
types: [python]
args: ["-i", "--remove-all-unused-imports", "--ignore-init-module-imports"]
- id: black
name: black
entry: poetry run black
language: system
types: [python]
require_serial: true
- id: flake8
name: flake8
entry: poetry run flake8
language: system
types: [python]
require_serial: true
- id: poetry_check
description: Check the integrity of pyproject.toml
name: poetry_check
entry: poetry check
language: system
pass_filenames: false
require_serial: true
# isorting our imports
- repo: https://github.com/PyCQA/isort
rev: 5.8.0
hooks:
- id: isort
# prettier to format our many yaml files
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.2.1
hooks:
- id: prettier
exclude: |
(?x)
# Those files have wrong syntax and would fail
^tests/demo_invalid/copier.yml|tests/demo_transclude_invalid(_multi)?/demo/copier.yml$
# HACK https://github.com/prettier/prettier/issues/9430
|^tests/demo
# miscellaneous hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-toml
- id: debug-statements
- id: detect-private-key
- id: end-of-file-fixer
exclude: \.noeof\. # Some tests require no EOF
- id: fix-encoding-pragma
args: ["--remove"]
- id: mixed-line-ending
args: ["--fix=lf"]
- id: trailing-whitespace