-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
52 lines (51 loc) · 1.7 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
# If you add any steps here, please also add them to CircleCI config in config.yml
exclude: ^(.*\.patch)|(.*\.snap)|(.*\.png)$
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: debug-statements
- id: check-added-large-files
- id: check-merge-conflict
- id: check-yaml
- id: check-xml
- repo: local
hooks:
# Updates syntax for newer Python versions
- id: pyupgrade
name: pyupgrade
entry: pyupgrade --py39-plus
language: system
types: [python]
# Python code linter
- id: flake8
name: flake8
entry: flake8
language: system
types: [python]
require_serial: true
# We need to mirror the exclusions in setup.cfg because when a file is passed
# directly to flake8, it ignores the exclusion settings. If we wouldn't do this,
# editing an excluded file would lead to it being checked anyway, and preventing
# a commit.
# Sort imports
# We do not use the default remote repo in order to avoid de-synchronisation
# between the installed version and the pre-commit version.
# Because of this, we might miss some new optimisation. Please check this link for changes:
# https://github.com/PyCQA/isort/blob/develop/.pre-commit-hooks.yaml
- id: isort
name: isort
entry: isort
require_serial: true
language: system
types: [python]
args: ['--filter-files']
# Code formatter
- id: black
name: black
entry: black
language: system
types: [python]
require_serial: true