-
Notifications
You must be signed in to change notification settings - Fork 55
/
.pre-commit-config.yaml
81 lines (81 loc) · 2.74 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
# https://pre-commit.com
exclude: 'examples|reports'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: debug-statements #Check for debugger imports and breakpoint() in python files
- id: check-ast #Simply check whether files parse as valid python
- id: fix-byte-order-marker #removes UTF-8 byte order marker
- id: check-json
- id: detect-private-key # detect-private-key is not in repo
- id: check-yaml
- id: check-added-large-files
- id: check-shebang-scripts-are-executable
- id: check-case-conflict #Check for files with names that would conflict on a case-insensitive filesystem like MacOS HFS+ or Windows FAT
- id: end-of-file-fixer #Makes sure files end in a newline and only a newline
- id: trailing-whitespace
- id: mixed-line-ending
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.4
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --line-length=79]
types_or: [python, pyi, jupyter]
- id: ruff-format
args: [--line-length=79]
types_or: [python, pyi, jupyter]
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort #isort is a pre-commit hook that runs to check for issues in imports and docstrings
args: [
"--profile", "black", "--filter-files",
"-l", "79"
]
- repo: https://github.com/asottile/blacken-docs
rev: 1.16.0
hooks:
- id: blacken-docs #blacken-docs is a pre-commit hook that runs to check for issues in the docs
additional_dependencies: [black]
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
hooks:
- id: pyupgrade #pyupgrade is a pre-commit hook that runs to check for issues in the code
args: [--py36-plus]
- repo: local
hooks:
- id: mypy # mypy is a pre-commit hook that runs as a linter to check for type errors
name: mypy
entry: mypy --implicit-optional
language: system
types: [python]
args: [
"--ignore-missing-imports",
"--explicit-package-bases",
"--check-untyped-defs"
]
stages:
- "pre-push"
- "pre-merge-commit"
- repo: local
hooks:
- id: pytest-check
name: pytest-check
language: python
types: [python]
entry: pytest
pass_filenames: false
always_run: true
args: [
--doctest-modules,
-o, addopts=""
]
- repo: https://github.com/roy-ht/pre-commit-jupyter
rev: v1.2.1
hooks:
- id: jupyter-notebook-cleanup
args:
- --remove-kernel-metadata
- --pin-patterns
- "[pin];[donotremove]"