-
Notifications
You must be signed in to change notification settings - Fork 64
/
Copy path.pre-commit-config.yaml
95 lines (90 loc) · 2.84 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
88
89
90
91
92
93
94
95
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_language_version:
python: python3
node: "16.17.0"
repos:
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0
hooks:
- id: prettier
files: \.(js|ts|jsx|tsx|css|less|html|json|markdown|md|yaml|yml)$
exclude: "lib|libs"
- repo: https://github.com/myint/autoflake
rev: v2.2.0
hooks:
- id: autoflake
args:
- --expand-star-imports
- --ignore-init-module-imports
- --in-place
- --remove-all-unused-imports
- --remove-duplicate-keys
- --remove-unused-variables
exclude: /__init__\.py$
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
# - id: check-yaml
# files: \.py$
- id: check-case-conflict
name: Check files conflict case-insensitive FS like MacOS HFS+ or Windows FAT.
- id: check-ast
name: Simply check whether files parse as valid python
- id: check-docstring-first
name: Checks for a common error of placing code before the docstring.
- id: check-json
- id: debug-statements
- id: requirements-txt-fixer
- id: check-symlinks
name: Checks for symlinks which do not point to anything.
- id: check-xml
- id: end-of-file-fixer
files: \.py$
- id: trailing-whitespace
files: \.py$
- repo: https://github.com/asottile/pyupgrade
rev: v3.1.0
hooks:
- id: pyupgrade
args: ["--keep-percent-format"]
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
name: Black Python code formatting
# entry: bash -c 'black "$@"; git add -u' --
language: python
types: [python]
args: ["--line-length=80"]
files: \.py$
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort except __init__.py
args:
- --settings=.
exclude: /__init__\.py$
# - repo: https://github.com/PyCQA/flake8
# rev: 3.9.2
# hooks:
# - id: flake8
# name: flake8
# additional_dependencies: ["flake8-bugbear==21.9.2"]
# - repo: https://github.com/PyCQA/pylint
# rev: v2.17.4
# hooks:
# - id: pylint
# # install it with pip
# python -m pip install pre-commit
# # generate a sample config (you'll want to modify it)
# pre-commit sample-config > .pre-commit-config.yaml
# # activate pre-commit in a repository
# pre-commit install
# # pre-commit will now run on future `git commit` operations!
# # optionally, the tool can be run standalone too:
# # manually run pre-commit on the current checked-in files (git add'd).
# pre-commit run
# # run pre-commit on all files selected in the config
# pre-commit run --all-files