-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
138 lines (137 loc) · 4 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# SPDX-FileCopyrightText: 2024 German Aerospace Center (DLR) <https://dlr.de>
#
# SPDX-License-Identifier: MIT
# CI Settings
ci:
skip: [mypy] # Apparently, mypy on pre-commit.ci uses Python 3.12 for which numpy 1.24.4 is not available
# Here are some commonly used pre-commit hooks. You can find more at:
# <https://github.com/pre-commit/pre-commit-hooks>
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-ast
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/fsfe/reuse-tool
rev: v4.0.3
hooks:
- id: reuse
name: Check license headers (REUSE)
# Deactivated as the pre-commit.ci service appears not to have access to the internet.
# Reactivate once switched to GitHub Actions.
# - repo: https://github.com/FHPythonUtils/LicenseCheck
# rev: '2024.2' # Do not update, breaks license check in pre-commit for dependencies
# hooks:
# - id: licensecheck
# language: python
# name: Check licenses of Python dependencies
# args: [--using, PEP631, --skip-dependencies, torch]
- repo: https://github.com/citation-file-format/cffconvert
rev: b6045d78aac9e02b039703b030588d54d53262ac
hooks:
- id: validate-cff
name: Validate CITATION.cff file
- repo: https://github.com/psf/black
rev: 24.10.0
hooks:
- id: black
name: Formatting Python code (black)
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
args: [--profile, black]
name: Sort Python imports (isort)
- repo: https://github.com/thlorenz/doctoc
rev: v2.2.0
hooks:
- id: doctoc
name: Generate table of contents for markdown files
args: [--github]
exclude: CODE_OF_CONDUCT.md
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
name: Fixing common spelling mistakes
args: [--write-changes, -L, assertIn]
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.29.4
hooks:
- id: check-github-workflows
name: Check GitHub Workflow configuration
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: 3.0.3
hooks:
- id: editorconfig-checker
exclude: docs/guide/api.rst
- repo: https://github.com/PyCQA/docformatter
rev: eb1df347edd128b30cd3368dddc3aa65edcfac38
hooks:
- id: docformatter
name: Fixing docstring formatting
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.42.0
hooks:
- id: markdownlint
name: Fixing markdown linting errors
args: [--disable, MD013, MD033, --fix]
- repo: https://github.com/MarcoGorelli/absolufy-imports
rev: v0.3.1
hooks:
- id: absolufy-imports
name: Make python imports absolute
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.0
hooks:
- id: pyupgrade
name: Upgrade common mistakes
args: [--py38-plus]
- repo: https://github.com/PyCQA/flake8
rev: 7.1.1
hooks:
- id: flake8
name: Linting Python code (flake8)
additional_dependencies:
- flake8-bugbear
- flake8-builtins
- flake8-comprehensions
- flake8-docstrings
- flake8-docstrings-complete
- flake8-simplify
- flake8-pyproject
- pep8-naming
- pydoclint
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.7.0
hooks:
- id: ruff
name: Linting Python code (ruff)
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.14.0
hooks:
- id: pretty-format-yaml
args: [--autofix, --indent, '2', CITATION.cff]
- id: pretty-format-toml
args: [--autofix]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.12.1
hooks:
- id: mypy
name: Static typechecking (mypy)
exclude: ^tests/
additional_dependencies:
- numpy==1.24.4
- types-requests