forked from UniMath/agda-unimath
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
164 lines (149 loc) · 5.3 KB
/
.pre-commit-config.yaml
File metadata and controls
164 lines (149 loc) · 5.3 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
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
fail_fast: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: mixed-line-ending
# Behavior depends on the Python version you're running with,
# there's no way to tell it to target a fixed minimum version
# - id: double-quote-string-fixer
- id: check-ast
- id: check-yaml
# - id: check-json # Doesn't accept json with comments
- id: requirements-txt-fixer
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
name: Spellcheck with codespell
types_or: [text, markdown]
args:
[
'--config',
'config/codespellrc',
'--builtin',
'clear,rare,informal,usage,code,names,en-GB_to_en-US',
'--dictionary',
'config/codespell-dictionary.txt,-',
]
- repo: local
hooks:
- id: sort-codespell-files
name: Sort codespell dictionary and ignore files
entry: bash -c 'for f in "$@"; do LC_ALL=C sort -o "$f" "$f"; done' --
language: system
files: ^config/codespell-(dictionary|ignore)\.txt$
- id: markdown-conventions
name: Markdown conventions
entry: scripts/markdown_conventions.py
language: python
always_run: true
files: ^src\/.+\.md$
types_or: [markdown, text]
- id: blank-line-conventions
# Depends on `markdown-conventions`
name: Blank line conventions in literate Agda Markdown files
entry: scripts/blank_line_conventions.py
language: python
always_run: true
files: ^src\/.+\.lagda\.md$
types_or: [markdown, text]
- id: fix-imports
name: Format imports of Agda files
entry: scripts/fix_imports.py
language: python
always_run: true
files: ^src\/.+\.lagda\.md$
types_or: [markdown, text]
- id: spaces-conventions-simple
name: Simple space conventions in Agda blocks
entry: scripts/spaces_conventions_simple.py
language: python
always_run: true
files: ^src\/.+\.lagda\.md$
types_or: [markdown, text]
- id: even-indentation-conventions
name: Even indentation conventions in Agda blocks
entry: scripts/even_indentation_conventions.py
language: python
always_run: true
files: ^src\/.+\.lagda\.md$
types_or: [markdown, text]
require_serial: true
- id: wrap-long-lines-simple
name: Wrap simple to fix long lines of Agda code
entry: scripts/wrap_long_lines_simple.py
language: python
always_run: true
files: ^src\/.+\.lagda\.md$
types_or: [markdown, text]
- id: max-line-length-conventions
# Should run after `wrap-long-lines-simple`
name: Check the maximum line length conventions
entry: scripts/max_line_length_conventions.py
language: python
files: ^src\/[^/]+\/.+\.lagda\.md$ # Don't match top level modules
types_or: [markdown, text]
require_serial: true
- id: generate-namespace-index-modules
name: Generate namespace indexes of modules
entry: scripts/generate_namespace_index_modules.py
language: python
always_run: true
pass_filenames: false
require_serial: true
# ! Experimental hook
# - id: spaces-convention
# name: Check Agda code block spaces convention
# entry: scripts/spaces_convention.py
# language: python
# always_run: true
# verbose: true
# files: ^src\/.+\.lagda\.md$
# types_or: [markdown, text]
# require_serial: false
# Run these checks after files are generated by the rules above
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-case-conflict
- id: check-merge-conflict
- repo: https://github.com/hhatto/autopep8
rev: 'v2.3.2'
hooks:
- id: autopep8
name: Python scripts formatting
args: ['-i', '--global-config', '/dev/null']
- repo: https://github.com/pre-commit/mirrors-prettier
rev: 'v4.0.0-alpha.8'
hooks:
- id: prettier
name: CSS, JS, YAML and Markdown (no codeblocks) formatting
types_or: [css, javascript, yaml, markdown]
args: ['--config', '.prettierrc.json']
- repo: https://github.com/FlamingTempura/bibtex-tidy
rev: v1.14.0
hooks:
- id: bibtex-tidy
name: BibTeX formatting
args:
[
'--modify',
'--align=14',
'--space=2',
'--blank-lines',
'--sort',
'--trailing-commas',
'--no-escape',
'--numeric',
'--months',
'--numeric',
'--duplicates=key,doi,abstract',
'--sort-fields=title,shorttitle,author,year,month,day,date,journal,fjournal,shortjournal,booktitle,location,on,publisher,address,series,volume,number,pages,doi,isbn,issn,eprint,eprinttype,archiveprefix,eprintclass,primaryclass,url,urldate,copyright,category,note,metadata',
'--encode-urls',
'--tidy-comments',
'--no-remove-empty-fields',
'--remove-dupe-fields',
]