-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
96 lines (88 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# Apply to all files without committing:
# pre-commit run --all-files
# Update this file:
# pre-commit autoupdate
repos:
#format markdown files
# Removing for now until fix is found to pkg_resources dependency when running azure pipeline
# https://github.com/pre-commit/pre-commit/issues/2122
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.0
hooks:
- id: prettier
types: [ markdown ]
args: [ "--prose-wrap", "always", "--print-width", "100" ]
# Autofix coding style
- repo: https://github.com/psf/black
rev: 22.8.0
hooks:
- id: black
# Complain about coding style that black can't fix
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
additional_dependencies:
- flake8-unused-arguments
- flake8-bugbear
- pep8-naming
- flake8-annotations
- flake8-builtins
#- flake8-docstrings
#- darglint
# Sort order of imports
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
name: isort
# Check typehints
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.971
hooks:
- id: mypy
args: [--ignore-missing-imports, --show-error-codes]
additional_dependencies:
- types-requests
- types-PyYAML
# Fix coding patterns from old Python versions
- repo: https://github.com/asottile/pyupgrade
rev: v2.38.0
hooks:
- id: pyupgrade
args: [--py36-plus]
# Misc checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-json
- id: check-yaml
args: [--allow-multiple-documents]
- id: debug-statements
- id: check-merge-conflict
- id: check-added-large-files
args: ['--maxkb=1000']
## Check for hardcoded secrets, eg passwords
#- repo: https://github.com/zricethezav/gitleaks
# rev: v8.5.2
# hooks:
# - id: gitleaks-docker
#
## Linting on Dockerfile
#- repo: https://github.com/AleksaC/hadolint-py
# rev: v2.9.3
# hooks:
# - id: hadolint
#
## Check security issues
#- repo: https://github.com/PyCQA/bandit
# rev: '1.7.4'
# hooks:
# - id: bandit
# args: ["--exclude", "tests"]
#
## Linting for sql files
#- repo: https://github.com/sqlfluff/sqlfluff
# rev: 0.11.2
# hooks:
# - id: sqlfluff-lint