Skip to content

Commit

Permalink
Fix formatting in README, remove prerequisite and reworked the Makefi…
Browse files Browse the repository at this point in the history
…le tests goals (#313)

* Fix formating in README

Signed-off-by: Cosmin Cojocar <[email protected]>

* Split the various test goals in the Makefile

Signed-off-by: Cosmin Cojocar <[email protected]>

* Remove the prerequisites from README since they are automatically installed

Signed-off-by: Cosmin Cojocar <[email protected]>

* Remove unnecessary install steps from Travis CI build

Signed-off-by: Cosmin Cojocar <[email protected]>

* Make sure golint is installed before running the lint command

Signed-off-by: Cosmin Cojocar <[email protected]>

* Make sure ginkgo command is installed before running the tests

Signed-off-by: Cosmin Cojocar <[email protected]>
  • Loading branch information
ccojocar authored May 2, 2019
1 parent b68ac76 commit 29cec13
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 19 deletions.
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
25 changes: 20 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
13 changes: 3 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 29cec13

Please sign in to comment.