Use .gitattributes to filter go sources through goimports

This commit is contained in:
Cheer Xiao 2014-02-10 12:40:02 +08:00
parent 42fcb8eb22
commit 615cbc2d0b
2 changed files with 22 additions and 0 deletions

1
.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
*.go filter=goimports

View File

@ -42,6 +42,27 @@ go get -u github.com/xiaq/elvish
Remember to put the two `export`s above into your `bashrc` or `zshrc` (or
whatever).
## Notes for Contributors
The `.gitattributes` in this repo dictates that go sources be filtered through
the `goimports` filter before checking in. If you would like to contribute,
you are advised to set up the filter:
1. Install `goimports`:
```
go get code.google.com/p/go.tools/cmd/goimports
```
2. Put this in `~/.gitconfig`:
```
[filter "goimports"]
clean = goimports -tabwidth=4
smudge = cat
required
```
## Name
In rogue-likes, items made by the elves have a reputation of high quality.