This repository has been archived by the owner on Jun 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
/
.pre-commit-config.yaml
115 lines (105 loc) · 3.15 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
107
108
109
110
111
112
113
114
115
# To update revisions, use `pre-commit autoupdate`
default_language_version:
python: python3
repos:
# Python
# TODO remove branch paths, should use specific revisions
# - repo: https://github.com/psf/black
# rev: 20.8b1
# hooks:
# - id: black
# name: python-black
#
# - repo: https://github.com/asottile/seed-isort-config
# rev: v1.9.3
# hooks:
# - id: seed-isort-config
# name: seed-isort-config
#
# - repo: https://github.com/timothycrosley/isort
# rev: 5.5.3
# hooks:
# - id: isort
# name: python-isort
# additional_dependencies: [toml]
# Rust
- repo: https://github.com/doublify/pre-commit-rust
rev: v1.0
hooks:
- id: fmt
name: cargo-fmt-bf2
args: [--manifest-path, beaconfuzz_v2/Cargo.toml, --]
- id: fmt
name: cargo-fmt-eth2fuzz
args: [--manifest-path, eth2fuzz/Cargo.toml, --]
- id: fmt
name: cargo-fmt-eth2diff
args: [--manifest-path, eth2diff/Cargo.toml, --]
# TODO currently doesn't work if Cargo.toml isn't in the root directory
# Can have a hook that takes in Cargo.toml files and uses manifest-path for each
# - id: cargo-check
# files: Cargo.toml
# types: [toml]
# Go
- repo: https://github.com/dnephin/pre-commit-golang
rev: v0.3.5
hooks:
# Not necessary with go-imports
#- id: go-fmt
#args: ['./...']
- id: go-imports
args: ['./...']
additional_dependencies: ['golang.org/x/tools/cmd/goimports']
# - id: go-vet
# args: ['./...']
# TODO resolve "Running error: context loading failed:"
# Would like to have some linting that doesn't require all dependencies to be installed
# - repo: https://github.com/golangci/golangci-lint
# rev: v1.21.0
# hooks:
# - id: golangci-lint
# go-vet doesn't work without building and installing dependencies
# "cannot find package ..."
# could be used for CI, but not pre-commit as it stands
# - repo: git://github.com/doublify/pre-commit-go
# rev: master
# hooks:
# - id: vet
# # TODO remove once go-vet "./..." works for dnephin hook
# name: go-vet
# args: ['./...']
# Shell
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 2.1.4
hooks:
# These need external installation
# TODO specify via additional_dependencies ?
- id: shellcheck
- id: shfmt
args: ['-l', '-i', '4', '-ci', '-w']
# C, C++ etc
- repo: https://gitlab.com/daverona/pre-commit/cpp
rev: 0.8.0
hooks:
- id: clang-format
- id: cpplint
args: ['--filter=-legal,-build/include_subdir,-build/c++11,-build/c++14,-runtime/int']
- id: cppcheck
# Makefile
# TODO checkmake doesn't allow usage like "checkmake f1 f2 f3" to provide
# multiple files at once
# - repo: https://github.com/Lucas-C/pre-commit-hooks-go
# rev: v1.0.0
# hooks:
# - id: checkmake
# pass_filenames: false
# files: '.*'
# types: [makefile]
# Misc/General
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: debug-statements
- id: check-merge-conflict