-
Notifications
You must be signed in to change notification settings - Fork 238
/
.pre-commit-config.yaml
106 lines (106 loc) · 3.77 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
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md, --markdown-linebreak-ext=pandoc]
exclude: "^Tests/Data/.*|^web/static|^Documentation/.vale/.*|.*\\.patch"
- id: check-added-large-files
args: [--maxkb 1024]
- id: check-merge-conflict
- id: check-xml
exclude: '^Tests/Data/.*\.xml'
- id: check-yaml
exclude: "^scripts/ci/.*|.cmake-format.yaml"
- id: check-toml
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: check-json
- id: fix-byte-order-marker
exclude: "^Documentation/.vale/.*"
- id: mixed-line-ending
exclude: ".*\\.vtu"
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
exclude: "LinearMFront/generate_ref.py"
# Run black on markdown notebooks
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.0
hooks:
- id: nbqa-black
additional_dependencies: [jupytext, black==23.1.0]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
hooks:
- id: codespell
exclude: 'Tests/Data/.*|.*\.ya?ml|.*\.bib|^web/content/imprint.md|^GeoLib/IO/XmlIO/OpenGeoSysSTN.xsd|^Applications/FileIO/Legacy/OGSIOVer4.cpp|^scripts/cmake/CPM.cmake|Documentation/.vale/.*|.*\.ipynb|.*\.svg'
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
hooks:
- id: cmake-format
additional_dependencies: ["cmakelang[YAML]"]
args: [--config=.cmake-format.yaml]
exclude: "CPM.cmake|FindFilesystem.cmake|FindMKL.cmake|JSONParser.cmake|Tests.cmake"
- id: cmake-lint
additional_dependencies: ["cmakelang[YAML]"]
exclude: "CPM.cmake|FindFilesystem.cmake|FindMKL.cmake|JSONParser.cmake|BuildExternalProject.cmake"
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.33.0
hooks:
- id: markdownlint
- repo: local
hooks:
- id: git-diff-check
name: Run git diff --check
entry: git diff --check --cached -- ':!*.md' ':!*.pandoc' ':!*.asc' ':!*.dat' ':!*.ts'
language: system
exclude: "Tests/Data/.*|web/static/images/xsd"
stages: [commit, manual]
- id: file-extensions
name: Check file extensions
entry: scripts/hooks/pre-commit-file-extensions.sh
language: system
files: '.*\.cpp'
stages: [commit, manual]
- id: git-clang-format
name: git-clang-format
entry: bash -c 'if command -v git-clang-format &> /dev/null; then git clang-format; else exit 0; fi'
language: system
pass_filenames: false
files: \.(h|cpp)$
- repo: https://github.com/errata-ai/vale
rev: v2.24.4
hooks:
- id: vale
name: vale sync
pass_filenames: false
args: [sync]
- id: vale
args: [--output=line, --minAlertLevel=error]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.5.0"
hooks:
- id: ruff
types_or: [python, pyi, jupyter]
args: [--output-format=full]
# A variant of the ruff hook above that automatically applies proposed fixes.
# Runs only manually.
# Run this hook (and all other manual hooks if any) with:
# pre-commit run --hook-stage manual
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.5.0"
hooks:
- id: ruff
types_or: [python, pyi, jupyter]
args: [--output-format=full, --fix, --exit-non-zero-on-fix]
stages: [manual]
# Enable on demand, run with
# pre-commit run --all-files clang-format
#
# - repo: https://github.com/pocc/pre-commit-hooks
# rev: master
# hooks:
# - id: clang-format
# args: ["-i"]