Skip to content

Commit 95134e4

Browse files
committed
docs: implement git client hook for developers, close #1578
1 parent 241a5b3 commit 95134e4

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

.pre-commit-config.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
fail_fast: true
2+
repos:
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v6.0.0
5+
hooks:
6+
- id: trailing-whitespace
7+
- id: end-of-file-fixer
8+
- id: check-json
9+
- id: check-yaml
10+
- id: check-toml
11+
- id: check-symlinks
12+
- id: fix-byte-order-marker
13+
- id: check-added-large-files
14+
- repo: https://github.com/dnephin/pre-commit-golang
15+
rev: v0.5.1
16+
hooks:
17+
- id: go-fmt
18+
- id: go-vet
19+
- id: go-imports
20+
- id: go-mod-tidy
21+
- id: no-go-testing
22+
- id: go-unit-tests
23+
- repo: https://github.com/golangci/golangci-lint
24+
rev: v2.4.0
25+
hooks:
26+
- id: golangci-lint

docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22

33
- [JSONRPC API](./xdc/jsonrpc.md)
44
- [Validator Contract](./xdc/validator.md)
5+
- [Development environment](develop.md)

docs/develop.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# How to setup development environment
2+
3+
## pre-commit
4+
5+
```bash
6+
# Install pre-commit
7+
pipx install pre-commit
8+
9+
# Install git hook
10+
pre-commit install
11+
12+
# Uninstall git hook
13+
pre-commit uninstall
14+
```

0 commit comments

Comments
 (0)