-
Notifications
You must be signed in to change notification settings - Fork 6
/
.pre-commit-config.yaml
87 lines (85 loc) · 2.76 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
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: master
hooks:
- id: check-merge-conflict
- id: check-added-large-files
args: ['--maxkb=30000']
- id: check-executables-have-shebangs
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: stable
hooks:
- id: black
language_version: python3.8
- repo: local
hooks:
- id: flake8
name: flake8
description: Python style guide enforcement.
entry: flake8
args: [
"--config=setup.cfg",
"--ignore=E501,PD011,F403,F405,W503,E231,VNE001"
]
additional_dependencies: [
flake8,
flake8-2020, # flake8 plugin which checks for misuse of `sys.version` or `sys.version_info`
flake8-blind-except, # A flake8 extension that checks for blind except: statements
flake8-builtins, # Check for python builtins being used as variables or parameters.
flake8-comprehensions, # It helps you write better list/set/dict comprehensions.
dlint, # Dlint is a tool for encouraging best coding practices and helping ensure we're writing secure Python code.
pandas-vet, # A Flake8 plugin that provides opinionated linting for pandas code
flake8-pytest, # pytest assert checker plugin for flake8
flake8-tabs, # Tab (or Spaces) indentation style checker for flake8
]
language: python
language_version: python3.8
types: [python]
require_serial: true
- id: autoflake
name: autoflake
description: remove unused imports
entry: autoflake
args: [
"--in-place",
"--remove-unused-variables"
]
language: python
language_version: python3.8
types: [python]
require_serial: true
additional_dependencies: [autoflake]
- id: isort
name: isort
description: Automatically sort imports.
entry: isort
args: [
"--recursive",
]
language: python
language_version: python3.8
types: [python]
require_serial: true
additional_dependencies: [isort]
- id: pytest
name: Run Pytest
description: Run Python unit-tests
entry: pytest
language: python
types: [python]
language_version: python3.8
require_serial: true
stages: [push]
additional_dependencies: [
pytest,
pytest-cov,
pytest-mock
]
- repo: https://github.com/commitizen-tools/commitizen
rev: v1.22.3
hooks:
- id: commitizen
stages: [commit-msg]