-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
102 lines (94 loc) · 3.33 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
102 lines (94 loc) · 3.33 KB
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
#
# Copyright (c) 2018-2026 M. Schuler, TTZ-EMO, Technical University of Applied
# Sciences Wuerzburg-Schweinfurt.
#
# This file is part of PyEMMO
# (see https://gitlab.ttz-emo.thws.de/ag-em/pyemmo).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
# This uses the suggestions from:
# https://medium.com/marvelous-mlops/welcome-to-pre-commit-heaven-5b622bb8ebce
repos:
# ISORT: Sorts Python imports according to the defined style. The tool options are
# controled by the pyproject.toml
- repo: https://github.com/pycqa/isort
rev: 8.0.1
hooks:
- id: isort
name: isort (python)
# Config is done in pyproject.toml !
# Run black as code formatter:
- repo: https://github.com/psf/black
rev: 26.3.1
hooks:
# Removed black since black-jupyter runs on .py files aswell! See
# https://github.com/psf/black/issues/3641#issuecomment-1501064536
- id: black-jupyter
# language_version: python3.9.13
# args:
# - --line-length=79
# PRE-COMMIT
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
# guard rails
- id: check-ast
- id: check-added-large-files
- id: check-toml
- id: check-yaml
# formatters
- id: end-of-file-fixer
- id: mixed-line-ending # Corrects inconsistent line endings in files (LF, CRLF)
- id: trailing-whitespace
# code checkers
- id: debug-statements
- id: check-merge-conflict
# - id: fix-encoding-pragma # fails with black formatting...
# Upgrades Python code to newer syntax versions. 3.6 or greater:
- repo: https://github.com/asottile/pyupgrade
rev: v3.21.2
hooks:
- id: pyupgrade
args: [--py39-plus]
# Upgrade documentation files: pyupgrade-docs provides a single executable
# (pyupgrade-docs) which will modify .rst / .md / .tex files in place.
- repo: https://github.com/verhovsky/pyupgrade-docs
rev: v0.3.0
hooks:
- id: pyupgrade-docs
args: [--py39-plus]
# # security issues python (Guard rails):
# - repo: https://github.com/PyCQA/bandit
# rev: 1.7.4
# hooks:
# - id: bandit
# args: ["-c", "pyproject.toml"]
# additional_dependencies: ["bandit[toml]"]
# This removes all unused import statements:
- repo: https://github.com/hadialqattan/pycln
rev: v2.6.0
hooks:
- id: pycln
args: [--all]
# # Type checks Python code using the MyPy static type checker.
# # We recommend to ignore missing imports in MyPy.
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v1.10.1
# hooks:
# - id: mypy
# # files: pyemmo
# # args: []