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:
Cosmin Cojocar 2019-05-02 09:19:18 +02:00 committed by GitHub
parent b68ac76dbc
commit 29cec138dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 19 deletions

View file

@ -6,12 +6,8 @@ go:
- tip - tip
install: 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 golang.org/x/crypto/ssh
- go get -u github.com/lib/pq - go get -u github.com/lib/pq
- go get -v -t ./...
- export PATH=$PATH:$HOME/gopath/bin - export PATH=$PATH:$HOME/gopath/bin
- export GO111MODULE=on - export GO111MODULE=on

View file

@ -4,17 +4,32 @@ FMT_CMD = $(gofmt -s -l -w $(find . -type f -name '*.go' -not -path './vendor/*'
IMAGE_REPO = securego IMAGE_REPO = securego
BUILDFLAGS := '-w -s' BUILDFLAGS := '-w -s'
CGO_ENABLED = 0 CGO_ENABLED = 0
GO := GO111MODULE=on go
GO_NOMOD :=GO111MODULE=off go
default: default:
$(MAKE) build $(MAKE) build
test: build test: build fmt lint sec
test -z '$(FMT_CMD)' $(GO_NOMOD) get -u github.com/onsi/ginkgo/ginkgo
go vet $(go list ./... | grep -v /vendor/)
golint -set_exit_status $(shell go list ./... | grep -v vendor)
./$(BIN) ./...
ginkgo -r -v 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: test-coverage:
go test -race -coverprofile=coverage.txt -covermode=atomic go test -race -coverprofile=coverage.txt -covermode=atomic

View file

@ -41,7 +41,9 @@ gosec --help
### Local Installation ### Local Installation
`$ go get github.com/securego/gosec/cmd/gosec ```bash
go get github.com/securego/gosec/cmd/gosec
```
## Usage ## Usage
@ -175,15 +177,6 @@ $ gosec -fmt=json -out=results.json *.go
## Development ## 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 ### Build
```bash ```bash