-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
103 lines (103 loc) · 3.67 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
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
- id: check-yaml
- id: check-added-large-files
- id: check-ast
- repo: https://github.com/ambv/black
rev: "19.10b0"
hooks:
- id: black
name: Reformat Python files with the black code formatter
files: '^.*(/PACKAGE)|(\.py)$'
exclude: >-
(?x)^(
exts/.*|
tools/prettify/fprettify/.|
tools/build_utils/fypp|
)$
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.26.0
hooks:
- id: markdownlint
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.7.1.1
hooks:
- id: shellcheck
exclude: >-
(?x)^(
benchmarks/QS_single_node/do_benchmark|
tools/autotools/autogen.sh|
tools/autotune_grid/(generate_makefile|get_results).sh|
tools/build_utils/get_revision_number|
tools/conventions/test_conventions.sh|
tools/doxify/(generate_doxygen.sh|doxify.sh)|
tools/formatting/test_formatting.sh|
tools/hfx_tools/(contraction/create|block_contraction/generate_hfx_contract_block)|
tools/toolchain/(
install_cp2k_toolchain.sh|
scripts/(common_vars|get_openblas_arch|setup_buildtools|signal_trap|tool_kit|generate_arch_files).sh|
scripts/install_(
acml|sirius|libsmm|libxc|mkl|cmake|openmpi|spfft|hdf5|intelmpi|
mathlibs|mpich|pexsi|ptscotch|superlu|cosma|quip|reflapack|
libxsmm|libint|elpa|fftw|libvdwxc|openblas|plumed|valgrind|gcc|
gsl|spglib|scalapack
).sh
)|
tools/manual/(update_manual|xml2htm)|
tools/plan_mpi_omp/plan.sh|
tools/precommit/deploy.sh|
tools/regtesting/do_regtest|
)$
- repo: local
hooks:
- id: doxify
name: Run doxify
entry: ./tools/doxify/doxify.sh
language: script
files: '^src/.*\.(F|f90)$'
- id: prettify
name: Run prettify
entry: ./tools/prettify/prettify.py --no-report-errors
language: script
files: '^src/.*\.(F|f90)$'
exclude: >-
(?x)^(
src/base/base_uses.f90|
src/common/util.F|
)$
- id: analyze_src
name: Run analyze_src
entry: ./tools/conventions/analyze_src.py --fail --suppressions ./tools/conventions/conventions.supp
language: script
files: '^src/.*\.(F|fypp|c|cu|cpp|h|hpp)$'
- id: regen_data
name: Regenerate checked-in data files
entry: make --always-make data
language: system
files: 'data/*'
pass_filenames: false
- id: clang-format
name: clang-format
description: Format files with ClangFormat.
entry: clang-format
language: python
files: \.(c|cc|cxx|cpp|frag|glsl|h|hpp|hxx|ih|ispc|ipp|java|js|m|mm|proto|textproto|vert)$
args: ['-i', '-fallback-style=none', '--style=llvm']
additional_dependencies: ['clang-format']
exclude: >-
(?x)^(
tools/manual/collapsibleList.js|
tools/manual/toggle_folding.js|
)$
- id: shfmt
name: 'Reformat shell scripts with shfmt'
minimum_pre_commit_version: 2.4.0
language: golang
additional_dependencies: [mvdan.cc/sh/v3/cmd/[email protected]]
entry: shfmt
args: ['-i=2', '-ci', '-sr', '-w']
files: '\.sh$'