-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
57 lines (56 loc) · 2.01 KB
/
.pre-commit-config.yaml
File metadata and controls
57 lines (56 loc) · 2.01 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
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: mixed-line-ending
args: ["--fix=lf"]
exclude: "^(docs/autogen|snapshots/)"
- id: trailing-whitespace
exclude: "^(docs/autogen|snapshots/)"
- id: end-of-file-fixer
exclude: "^(docs/autogen|snapshots/)"
- id: check-merge-conflict
- id: check-json
exclude: "^(docs/autogen|snapshots/)"
- id: check-yaml
- repo: local
hooks:
- id: sort-imports
name: Sort imports
description: Normalize and sort import statements in Solidity files
language: system
entry: python3 script/utils/sort_imports.py
files: "^(src|examples)/.*\\.sol$"
pass_filenames: true
- id: sort-errors
name: Sort solidity errors
description: Alphabetize error declarations in Solidity files
language: system
entry: python3 script/utils/sort_errors.py
files: "^(src|examples)/.*\\.sol$"
pass_filenames: true
- id: format
name: Format solidity code
description: Format solidity code with `forge fmt`
language: system
entry: forge fmt
files: '\.sol$'
exclude: "^lib/"
pass_filenames: true
- id: doc
name: Generate documentation
description: Generate docs with `forge doc`
language: system
entry: bash -lc 'forge build; rm -rf docs/autogen; forge doc -b -o docs/autogen'
pass_filenames: false
- id: forge-snapshots
name: Update forge snapshots
language: system
entry: bash -lc 'mkdir -p snapshots; forge build; forge build --sizes | tee snapshots/sizes.txt >/dev/null; forge test --isolate --gas-report | tee snapshots/gas.txt >/dev/null'
pass_filenames: false
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
- id: prettier
name: Format non-solidity files with prettier
exclude: "^(docs/autogen|snapshots/)"