Skip to content

Commit a42bece

Browse files
committed
Better linting and testing of code
1 parent 6d2c8b5 commit a42bece

File tree

3 files changed

+52
-1
lines changed

3 files changed

+52
-1
lines changed

.circleci/config.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,22 @@ jobs:
77
working_directory: /go/src/github.com/joshdk/go-junit
88
steps:
99
- checkout
10-
- run: gofmt -l -s .
10+
- run:
11+
name: Install build tools
12+
command: |
13+
go get -u github.com/alecthomas/gometalinter
14+
go get -u github.com/jstemmer/go-junit-report
15+
gometalinter --install
16+
mkdir test-results
17+
- run:
18+
name: Lint Go code
19+
command: gometalinter
20+
- run:
21+
name: Test Go code
22+
command: go test -v 2>&1 | tee test-results/report.log
23+
- run:
24+
name: Generate test report
25+
command: cat test-results/report.log | go-junit-report -go-version $GOLANG_VERSION > test-results/report.xml
26+
when: always
27+
- store_test_results:
28+
path: test-results

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
test-results/

.gometalinter.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"Disable": [
3+
"gosimple",
4+
"lll",
5+
"staticcheck",
6+
"unused"
7+
],
8+
"Enable": [
9+
"deadcode",
10+
"dupl",
11+
"errcheck",
12+
"gas",
13+
"goconst",
14+
"gocyclo",
15+
"goimports",
16+
"golint",
17+
"gotype",
18+
"gotypex",
19+
"ineffassign",
20+
"interfacer",
21+
"maligned",
22+
"megacheck",
23+
"misspell",
24+
"nakedret",
25+
"safesql",
26+
"structcheck",
27+
"unconvert",
28+
"unparam",
29+
"varcheck",
30+
"vet"
31+
]
32+
}

0 commit comments

Comments
 (0)