Merge pull request #4168 from flycash/ftr/layout

Add git hooks
This commit is contained in:
Ming Deng 2020-08-18 21:08:56 +08:00 committed by GitHub
commit 63599c0032
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 0 deletions

View File

@ -7,6 +7,22 @@ It is the work of hundreds of contributors. We appreciate your help!
Here are instructions to get you started. They are probably not perfect,
please let us know if anything feels wrong or incomplete.
## Prepare environment
Firstly, install some tools. Execute those commands **outside** the project. Or those command will modify go.mod file.
```shell script
go get -u golang.org/x/tools/cmd/goimports
go get -u github.com/gordonklaus/ineffassign
```
And the go into project directory, run :
```shell script
cp ./githook/pre-commit ./.git/hooks/pre-commit
```
This will add git hooks into .git/hooks. Or you can add it manually.
## Contribution guidelines
### Pull requests

7
githook/pre-commit Executable file
View File

@ -0,0 +1,7 @@
goimports -l pkg
goimports -l examples
ineffassign .
staticcheck -show-ignored -checks "-ST1017,-U1000,-ST1005,-S1034,-S1012,-SA4006,-SA6005,-SA1019,-SA1024" ./pkg