-
Notifications
You must be signed in to change notification settings - Fork 1
/
.pre-commit-config.yaml
73 lines (70 loc) · 2.35 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
# 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/myint/autoflake
# rev: v2.3.1
# 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: v4.5.0
hooks:
- 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: 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.15.2
hooks:
- id: pyupgrade
args: ["--keep-percent-format"]
- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
name: Black Python code formatting
language: python
types: [python]
args: ["--line-length=100"]
files: \.py$
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
name: isort except __init__.py
args:
- --settings=.
exclude: /__init__\.py$
# - repo: https://github.com/PyCQA/pylint
# rev: v2.17.4
# hooks:
# - id: pylint
# args:
# - --disable=import-error, missing-module-docstring, broad-exception-caught, missing-function-docstring, missing-class-docstring, import-outside-toplevel,line-too-long,unused-variable,too-many-arguments,too-many-instance-attributes,no-name-in-module,redefined-builtin,invalid-name
# install it with pip
# python -m pip install pre-commit
# activate pre-commit in a repository
# pre-commit install
# run pre-commit on all files selected in the config
# pre-commit run --all-files