-
Notifications
You must be signed in to change notification settings - Fork 50
/
.pre-commit-config.yaml
84 lines (84 loc) · 2.57 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
---
exclude: ^(\.[^/]*cache(__)?/.*|(.*/)?\.coverage)$
repos:
# Perform Markdown formatting before other hooks "fixing" line endings:
# PROBLEM: it alters the .md file permissions from 644 to 600 :(
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
hooks:
- id: mdformat
name: Format Markdown
entry: mdformat # Executable to run, with fixed options
language: python
types: [markdown]
args: [--wrap, '75', --number]
additional_dependencies:
- mdformat-toc
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: forbid-crlf
- id: remove-crlf
- id: forbid-tabs
exclude: tests/resources/main.*_with_license.cpp
- id: remove-tabs
exclude: tests/resources/main.*_with_license.cpp
- id: chmod
args: ['644']
exclude: (\.md$|^tests/resources/.*shebang)
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
files: ''
exclude: tests/resources/main.*_with_license.cpp
- id: check-yaml
- id: check-merge-conflict
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
args:
- --py37-plus
exclude: ^tests/resources/.*
- repo: https://github.com/psf/black
rev: 23.12.1
hooks:
- id: black
exclude: ^tests/resources/
- repo: https://github.com/Lucas-C/pre-commit-hooks-bandit
rev: v1.0.6
hooks:
- id: python-bandit-vulnerability-check
args: [--skip, 'B101', --recursive, .]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
args:
- --ignore-missing-imports
- --install-types
- --non-interactive
- --check-untyped-defs
- --show-error-codes
- --show-error-context
- repo: local
hooks:
- id: pylint
name: pylint
# 3x faster than the official pylint hook, and has no issue with imports
# (tested with: time pre-commit run pylint --all-files)
language: system
entry: pylint
files: \.py$
exclude: ^tests/resources/.*(init_with_license|todo)
- id: pytest
name: pytest
language: python
additional_dependencies: [pytest, pytest-cov, coverage, rapidfuzz]
entry: pytest -vv
require_serial: true
pass_filenames: false
files: \.py$