mirror of
https://github.com/securego/gosec.git
synced 2024-11-05 19:45:51 +00:00
Fix formatting in README, remove prerequisite and reworked the Makefile tests goals (#313)
* Fix formating in README Signed-off-by: Cosmin Cojocar <cosmin.cojocar@gmx.ch> * Split the various test goals in the Makefile Signed-off-by: Cosmin Cojocar <cosmin.cojocar@gmx.ch> * Remove the prerequisites from README since they are automatically installed Signed-off-by: Cosmin Cojocar <cosmin.cojocar@gmx.ch> * Remove unnecessary install steps from Travis CI build Signed-off-by: Cosmin Cojocar <cosmin.cojocar@gmx.ch> * Make sure golint is installed before running the lint command Signed-off-by: Cosmin Cojocar <cosmin.cojocar@gmx.ch> * Make sure ginkgo command is installed before running the tests Signed-off-by: Cosmin Cojocar <cosmin.cojocar@gmx.ch>
This commit is contained in:
parent
b68ac76dbc
commit
29cec138dc
3 changed files with 23 additions and 19 deletions
|
@ -6,12 +6,8 @@ go:
|
|||
- tip
|
||||
|
||||
install:
|
||||
- go get -u golang.org/x/lint/golint
|
||||
- go get -u github.com/onsi/ginkgo/ginkgo
|
||||
- go get -u github.com/onsi/gomega
|
||||
- go get -u golang.org/x/crypto/ssh
|
||||
- go get -u github.com/lib/pq
|
||||
- go get -v -t ./...
|
||||
- export PATH=$PATH:$HOME/gopath/bin
|
||||
- export GO111MODULE=on
|
||||
|
||||
|
|
25
Makefile
25
Makefile
|
@ -4,17 +4,32 @@ FMT_CMD = $(gofmt -s -l -w $(find . -type f -name '*.go' -not -path './vendor/*'
|
|||
IMAGE_REPO = securego
|
||||
BUILDFLAGS := '-w -s'
|
||||
CGO_ENABLED = 0
|
||||
GO := GO111MODULE=on go
|
||||
GO_NOMOD :=GO111MODULE=off go
|
||||
|
||||
default:
|
||||
$(MAKE) build
|
||||
|
||||
test: build
|
||||
test -z '$(FMT_CMD)'
|
||||
go vet $(go list ./... | grep -v /vendor/)
|
||||
golint -set_exit_status $(shell go list ./... | grep -v vendor)
|
||||
./$(BIN) ./...
|
||||
test: build fmt lint sec
|
||||
$(GO_NOMOD) get -u github.com/onsi/ginkgo/ginkgo
|
||||
ginkgo -r -v
|
||||
|
||||
fmt:
|
||||
@echo "FORMATTING"
|
||||
@FORMATTED=`$(GO) fmt ./...`
|
||||
@([[ ! -z "$(FORMATTED)" ]] && printf "Fixed unformatted files:\n$(FORMATTED)") || true
|
||||
|
||||
lint:
|
||||
@echo "LINTING"
|
||||
$(GO_NOMOD) get -u golang.org/x/lint/golint
|
||||
golint -set_exit_status ./...
|
||||
@echo "VETTING"
|
||||
$(GO) vet ./...
|
||||
|
||||
sec:
|
||||
@echo "SECURITY SCANNING"
|
||||
./$(BIN) ./...
|
||||
|
||||
test-coverage:
|
||||
go test -race -coverprofile=coverage.txt -covermode=atomic
|
||||
|
||||
|
|
13
README.md
13
README.md
|
@ -41,7 +41,9 @@ gosec --help
|
|||
|
||||
### Local Installation
|
||||
|
||||
`$ go get github.com/securego/gosec/cmd/gosec
|
||||
```bash
|
||||
go get github.com/securego/gosec/cmd/gosec
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
|
@ -175,15 +177,6 @@ $ gosec -fmt=json -out=results.json *.go
|
|||
|
||||
## Development
|
||||
|
||||
### Prerequisites
|
||||
|
||||
Install dep according to the instructions here: https://github.com/golang/dep
|
||||
Install the latest version of golint:
|
||||
|
||||
```bash
|
||||
go get -u golang.org/x/lint/golint
|
||||
```
|
||||
|
||||
### Build
|
||||
|
||||
```bash
|
||||
|
|
Loading…
Reference in a new issue