Skip to content

Commit ad72e5c

Browse files
committed
Improve Makefile
- Check fmt using golangci - Proerly install golangci - Fix error when `make build`
1 parent 73b33e5 commit ad72e5c

File tree

5 files changed

+13
-32
lines changed

5 files changed

+13
-32
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ website/node_modules
2020
.idea
2121
*.iml
2222
*.test
23-
*.iml
2423
log.txt
2524
vendor/
2625
.vscode/

.travis.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,3 @@ matrix:
2121
- go: "1.12.x"
2222
name: "Code UnitTest"
2323
script: make test
24-
25-
env:
26-
- GO111MODULE=on

GNUmakefile

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
11
TEST?=./...
22
PKG_NAME=mongodbatlas
3+
export GO111MODULE := on
4+
export PATH := ./bin:$(PATH)
35

46
default: build
57

6-
build: fmtcheck
7-
go install
8+
build:
9+
go install ./$(PKG_NAME)
810

9-
10-
test: fmtcheck
11+
test:
1112
go test $(TEST) -timeout=30s -parallel=4 -cover
1213

1314
fmt:
1415
@echo "==> Fixing source code with gofmt..."
1516
gofmt -s -w ./$(PKG_NAME)
1617

17-
fmtcheck:
18-
@sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'"
19-
2018
lint:
2119
@echo "==> Checking source code against linters..."
22-
@GOGC=30 golangci-lint run ./$(PKG_NAME)
20+
golangci-lint run $(TEST) -E gofmt
2321

24-
tools:
25-
go install github.com/golangci/golangci-lint/cmd/golangci-lint
22+
check: test lint
2623

24+
tools:
25+
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.21.0
2726

28-
.PHONY: build test fmt fmtcheck lint tools
27+
.PHONY: build test fmt lint check tools

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import (
3737
"log"
3838
"os"
3939

40-
digest "github.com/Sectorbob/mlab-ns2/gae/ns/digest"
40+
"github.com/Sectorbob/mlab-ns2/gae/ns/digest"
4141
"github.com/mongodb/go-client-mongodb-atlas/mongodbatlas"
4242
)
4343

@@ -87,13 +87,12 @@ Each version of the client is tagged and the version is updated accordingly.
8787
To see the list of past versions, run `git tag`.
8888

8989

90-
9190
## Development and contribution
9291

9392
Feel free to open an Issue or PR! Our contribution guidelines are a WIP but generally follow the official [Terraform Guidelines](https://www.terraform.io/docs/extend/community/contributing.html).
9493

9594
```
9695
git clone [email protected]:mongodb/go-client-mongodb-atlas.git
9796
make tools
98-
make test
99-
```
97+
make check
98+
```

scripts/gofmtcheck.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)