Skip to content

Commit 29cec13

Browse files
authored
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>
1 parent b68ac76 commit 29cec13

File tree

3 files changed

+23
-19
lines changed

3 files changed

+23
-19
lines changed

.travis.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,8 @@ go:
66
- tip
77

88
install:
9-
- go get -u golang.org/x/lint/golint
10-
- go get -u github.com/onsi/ginkgo/ginkgo
11-
- go get -u github.com/onsi/gomega
129
- go get -u golang.org/x/crypto/ssh
1310
- go get -u github.com/lib/pq
14-
- go get -v -t ./...
1511
- export PATH=$PATH:$HOME/gopath/bin
1612
- export GO111MODULE=on
1713

Makefile

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,32 @@ FMT_CMD = $(gofmt -s -l -w $(find . -type f -name '*.go' -not -path './vendor/*'
44
IMAGE_REPO = securego
55
BUILDFLAGS := '-w -s'
66
CGO_ENABLED = 0
7+
GO := GO111MODULE=on go
8+
GO_NOMOD :=GO111MODULE=off go
79

810
default:
911
$(MAKE) build
1012

11-
test: build
12-
test -z '$(FMT_CMD)'
13-
go vet $(go list ./... | grep -v /vendor/)
14-
golint -set_exit_status $(shell go list ./... | grep -v vendor)
15-
./$(BIN) ./...
13+
test: build fmt lint sec
14+
$(GO_NOMOD) get -u github.com/onsi/ginkgo/ginkgo
1615
ginkgo -r -v
1716

17+
fmt:
18+
@echo "FORMATTING"
19+
@FORMATTED=`$(GO) fmt ./...`
20+
@([[ ! -z "$(FORMATTED)" ]] && printf "Fixed unformatted files:\n$(FORMATTED)") || true
21+
22+
lint:
23+
@echo "LINTING"
24+
$(GO_NOMOD) get -u golang.org/x/lint/golint
25+
golint -set_exit_status ./...
26+
@echo "VETTING"
27+
$(GO) vet ./...
28+
29+
sec:
30+
@echo "SECURITY SCANNING"
31+
./$(BIN) ./...
32+
1833
test-coverage:
1934
go test -race -coverprofile=coverage.txt -covermode=atomic
2035

README.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ gosec --help
4141

4242
### Local Installation
4343

44-
`$ go get github.com/securego/gosec/cmd/gosec
44+
```bash
45+
go get github.com/securego/gosec/cmd/gosec
46+
```
4547

4648
## Usage
4749

@@ -175,15 +177,6 @@ $ gosec -fmt=json -out=results.json *.go
175177

176178
## Development
177179

178-
### Prerequisites
179-
180-
Install dep according to the instructions here: https://github.com/golang/dep
181-
Install the latest version of golint:
182-
183-
```bash
184-
go get -u golang.org/x/lint/golint
185-
```
186-
187180
### Build
188181

189182
```bash

0 commit comments

Comments
 (0)