Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ashwch/precommit-vet-lint
A precommit hook that runs Golint and Vet on your staged go files.
https://github.com/ashwch/precommit-vet-lint
go-vet golang golint hooks pre-commit
Last synced: 3 months ago
JSON representation
A precommit hook that runs Golint and Vet on your staged go files.
- Host: GitHub
- URL: https://github.com/ashwch/precommit-vet-lint
- Owner: ashwch
- License: mit
- Created: 2016-11-26T11:37:27.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-11-26T11:53:52.000Z (about 8 years ago)
- Last Synced: 2024-08-02T01:26:20.163Z (6 months ago)
- Topics: go-vet, golang, golint, hooks, pre-commit
- Language: Go
- Size: 6.84 KB
- Stars: 29
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-repositories - ashwch/precommit-vet-lint - A precommit hook that runs Golint and Vet on your staged go files. (Go)
README
Precommit-vet-lint
===A precommit hook that runs on your staged Go file and reports errors returned by [Golint](https://github.com/golang/lint) and [Vet](https://golang.org/cmd/vet/).
### Installation
---```bash
go get -u github.com/golang/lint/golint
go get -u github.com/ashwch/precommit-vet-lint
```### Usage
---Copy the contents of pre-commit file included with this repo in your `.git/hooks/pre-commit` file. Make sure the file has executable permissions.
### Example
```bash
$ git status
On branch master
Changes to be committed:
(use "git reset HEAD ..." to unstage)new file: helpers.go
new file: precommit-vet-lint.goUntracked files:
(use "git add ..." to include in what will be committed)precommit-vet-lint
$ git commit -m "Added core files"
Running Golint and Vet...
Failed Following linting error(s) found:
helpers.go:14:1: exported function CheckError should have comment or be unexported
helpers.go:20:1: exported function GetStagedFiles should have comment or be unexported
helpers.go:48:1: exported function GetProjectBasePath should have comment or be unexported
helpers.go:53:1: exported function GetStagedContent should have comment or be unexported
helpers.go:60:1: exported function GetLintErrors should have comment or be unexported
helpers.go:69:1: exported function GetVetErrors should have comment or be unexported
helpers.go:83:6: exported type TempDir should have comment or be unexported
helpers.go:87:1: exported method TempDir.Create should have comment or be unexported
helpers.go:93:1: exported method TempDir.Close should have comment or be unexported.
```