-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
87 lines (78 loc) · 3.13 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
default_language_version:
# python: python3.11.5
# python: python3.10.13
python: python3.13.0
# 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.2.0
hooks:
- id: trailing-whitespace # trims trailing whitespace.
- id: end-of-file-fixer # ensures that a file is either empty, or ends with one newline.
- id: check-yaml # checks yaml files for parseable syntax.
- id: check-merge-conflict # checks for files that contain merge conflict strings.
- id: check-toml # checks for files that contain merge conflict strings.
- id: sort-simple-yaml # checks for files that contain merge conflict strings.
- id: check-case-conflict # checks for files that would conflict in case-insensitive filesystems.
- id: check-added-large-files
args: ["--maxkb=2000"] # prevents giant files from being committed.
exclude: Gen2_8x24n7 #
# mypy i.e. type checking. Checks with --ignore-missing-imports for technical reasons
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1 # Use the sha / tag you want to point at
hooks:
- id: mypy
additional_dependencies: [types-toml==0.10.8.7]
# pygrep-hooks. Checks for type stuff
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0 # Use the ref you want to point at
hooks:
- id: python-use-type-annotations # Enforce that python3.6+ type annotations are used instead of type comments
- id: python-check-blanket-noqa # Enforce that noqa annotations always occur with specific codes. Sample annotations: # noqa: F401, # noqa: F401,W203
# Auto-formatter
- repo: https://github.com/google/yapf
rev: v0.40.1 # Use the sha / tag you want to point at
hooks:
- id: yapf
name: yapf
language: python
entry: yapf
args: [-i, -m, "--style={based_on_style: pep8, column_limit: 100, indent_width: 4, spaces_before_comment: 2}"]
types: [python]
# adds the branch to the commit message automatically
# This is broken sadly
- repo: https://github.com/milin/giticket
rev: v1.4
hooks:
- id: giticket
- repo: https://github.com/fortran-lang/fprettify
rev: v0.3.7
hooks:
- id: fprettify
name: auto-formatter for modern fortran source code
description: imposes strict whitespace formatting for modern (F90+) Fortran code
entry: fprettify -c .fprettify.rc
language: python
files: \.[fF]\d*$
- repo: local
hooks:
- id: compile-fpm
name: Test successful compilation with fpm
entry: fpm build --flag "-ffree-line-length-none"
language: system
pass_filenames: false
always_run: true
- repo: local
hooks:
- id: fortitude-lint
name: Run Fortitude linter
entry: fortitude check --line-length 150
language: system
pass_filenames: yes
always_run: true
files: \.[fF]\d*$
#files: ^(?!build/).*\.([fF]\d*)$
#files: ^(?!\./build/).*\.([fF]\d*)$
#files: ^(?!.*\/build\/).*\.([fF]\d*)$
#files: ^src/.*\.([fF]\d*)$