-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
99 lines (99 loc) · 3.06 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
97
98
99
# https://pre-commit.com
exclude: 'examples|reports'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.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.1.4
hooks:
- id: ruff
args: [--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.12.0
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/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
name: flake8
language: python
types: [python]
entry: flake8
args: [--config=.flake8]
- repo: https://github.com/ambv/black
rev: 23.10.1
hooks:
- id: black
language: python
types: [python]
args: ["--line-length=79"]
- repo: https://github.com/asottile/blacken-docs
rev: v1.12.1
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: v2.37.0
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: pytest-check
name: pytest-check
language: python
types: [python]
entry: pytest
pass_filenames: false
always_run: true
args: [
--doctest-modules,
-o, addopts=""
]
- 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: make
name: make
language: python
types: [python]
entry: make execute-notebooks
stages:
- "pre-push"
- "pre-merge-commit"