Skip to content

Commit 28a8ff9

Browse files
authored
Merge pull request #7 from fredbi/ci-linting
updated CI
2 parents 7775307 + 56fcc93 commit 28a8ff9

File tree

3 files changed

+58
-5
lines changed

3 files changed

+58
-5
lines changed

.golangci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
linters-settings:
2+
govet:
3+
check-shadowing: true
4+
golint:
5+
min-confidence: 0
6+
gocyclo:
7+
min-complexity: 30
8+
maligned:
9+
suggest-new: true
10+
dupl:
11+
threshold: 100
12+
goconst:
13+
min-len: 2
14+
min-occurrences: 4
15+
linters:
16+
enable-all: true
17+
disable:
18+
- maligned
19+
- lll
20+
- gochecknoglobals
21+
- godox
22+
- gocognit
23+
- whitespace
24+
- wsl
25+
- funlen
26+
- gochecknoglobals
27+
- gochecknoinits
28+
- scopelint
29+
- wrapcheck
30+
- exhaustivestruct
31+
- exhaustive
32+
- nlreturn
33+
- testpackage
34+
- gci
35+
- gofumpt
36+
- goerr113
37+
- gomnd
38+
- tparallel
39+
- nestif
40+
- godot
41+
- errorlint

.travis.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
after_success:
22
- bash <(curl -s https://codecov.io/bash)
33
go:
4-
- 1.11.x
5-
- 1.12.x
4+
- 1.14.x
5+
- 1.x
66
install:
7-
- GO111MODULE=off go get -u gotest.tools/gotestsum
7+
- go get gotest.tools/gotestsum
8+
jobs:
9+
include:
10+
# include linting job, but only for latest go version and amd64 arch
11+
- go: 1.x
12+
arch: amd64
13+
install:
14+
go get github.com/golangci/golangci-lint/cmd/golangci-lint
15+
script:
16+
- golangci-lint run --new-from-rev master
817
env:
918
- GO111MODULE=on
1019
language: go

reference_test.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ func TestIsRoot(t *testing.T) {
4747
}))
4848
}
4949

50+
// nolint: dupl
5051
func TestFull(t *testing.T) {
5152

5253
in := "http://host/path/a/b/c#/f/a/b"
@@ -81,6 +82,7 @@ func TestFull(t *testing.T) {
8182
}
8283
}
8384

85+
// nolint: dupl
8486
func TestFullURL(t *testing.T) {
8587

8688
in := "http://host/path/a/b/c"
@@ -156,6 +158,7 @@ func TestFragmentOnly(t *testing.T) {
156158
assert.Equal(t, r3.String(), in[1:])
157159
}
158160

161+
// nolint: dupl
159162
func TestURLPathOnly(t *testing.T) {
160163

161164
in := "/documents/document.json"
@@ -190,6 +193,7 @@ func TestURLPathOnly(t *testing.T) {
190193
}
191194
}
192195

196+
// nolint: dupl
193197
func TestURLRelativePathOnly(t *testing.T) {
194198

195199
in := "document.json"
@@ -393,13 +397,12 @@ func TestReferenceResolution(t *testing.T) {
393397
"g#s/../x", "http://a/b/c/g#s/../x",
394398

395399
"http:g", "http:g", // for strict parsers
396-
//"http:g", "http://a/b/c/g", // for backward compatibility
400+
// "http:g", "http://a/b/c/g", // for backward compatibility
397401

398402
}
399403
for i := 0; i < len(checks); i += 2 {
400404
child := checks[i]
401405
expected := checks[i+1]
402-
// fmt.Printf("%d: %v -> %v\n", i/2, child, expected)
403406

404407
childRef, e := New(child)
405408
if e != nil {

0 commit comments

Comments
 (0)