-
Notifications
You must be signed in to change notification settings - Fork 16
/
.pre-commit-config.yaml
54 lines (46 loc) · 1.81 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
####################################################
# Checks about the pre-commit configuration itself #
####################################################
repos:
- repo: meta
hooks:
- id: check-hooks-apply # Ensures all defined hooks affect at least one file in the repo
- id: check-useless-excludes # Ensures all defined excludes apply to at least one file in the repo
###########################
# General use / built-ins #
###########################
# Click through to this repository to see what other goodies are available
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace # Removes trailing whitespace from lines in all file types
- id: end-of-file-fixer # Fixes last line of all file types
- id: check-merge-conflict # Checks if you're about to commit a file that hasn't had conflicts resolved
- id: no-commit-to-branch # Checks if you're committing to a disallowed branch
args: [--branch, dev]
- id: check-ast # Checks that Python files are valid syntax
- id: check-toml # Checks TOML files for syntax errors
##########
# Python #
##########
# pyupgrade updates older syntax to newer syntax.
- repo: https://github.com/asottile/pyupgrade
rev: v3.17.0
hooks:
- id: pyupgrade
args: [--py39-plus]
# Run black last on Python code so all changes from previous hooks are reformatted
- repo: https://github.com/psf/black
rev: 24.8.0
hooks:
- id: black
language_version: python3.9
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.1
hooks:
- id: mypy
additional_dependencies: [typing_extensions, types-requests, types-urllib3]