Skip to content

Commit 68d85e4

Browse files
authored
Merge pull request #17 from maratori/update
Minor updates
2 parents 1b1da12 + f9bc51b commit 68d85e4

File tree

7 files changed

+72
-26
lines changed

7 files changed

+72
-26
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
.idea/
22
.DS_Store
3-
*.out
3+
coverage.out
4+
go.check.mod
5+
go.check.sum

.golangci.yml

+16-3
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@ linters-settings:
1919
check-exported: true # default false
2020
varcheck:
2121
exported-fields: true # default false
22+
2223
dupl:
2324
threshold: 150 # default 150
2425
funlen:
2526
lines: 60 # default 60
2627
statements: 40 # default 40
2728
gocognit:
28-
min-complexity: 10 # minimal code complexity to report, 30 by default (but we recommend 10-20)
29+
min-complexity: 15 # minimal code complexity to report, 30 by default (but we recommend 10-20)
2930
goconst:
3031
min-len: 3 # default 3
3132
min-occurrences: 3 # default 3
@@ -42,7 +43,13 @@ linters-settings:
4243
goimports:
4344
local-prefixes: github.com/maratori/testpackage
4445
golint:
45-
min-confidence: 0.1 # default 0.8
46+
min-confidence: 0 # default 0.8
47+
gomnd:
48+
settings:
49+
mnd:
50+
# the list of enabled checks, see https://github.com/tommy-muehle/go-mnd/#checks for description.
51+
checks: argument,case,condition,operation,return,assign # default argument,case,condition,operation,return,assign
52+
ignored-numbers: 0,1 # default 0,1
4653
lll:
4754
line-length: 120 # default 120
4855
maligned:
@@ -78,7 +85,7 @@ linters:
7885
- structcheck
7986
- typecheck
8087
#- unused # false positives
81-
#- varcheck # false positives
88+
- varcheck
8289
## disabled by default
8390
- bodyclose
8491
- dupl
@@ -91,18 +98,24 @@ linters:
9198
- gocyclo
9299
- goimports
93100
- golint
101+
- gomnd
102+
- goprintffuncname
94103
- gosec
95104
- lll
96105
- maligned
97106
- misspell
98107
- nakedret
99108
- prealloc
109+
- rowserrcheck
100110
- scopelint
101111
- unconvert
102112
- unparam
103113
- whitespace
104114
- wsl
105115

116+
output:
117+
uniq-by-line: false # default true
118+
106119
issues:
107120
max-issues-per-linter: 0
108121
max-same-issues: 0

.travis.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
language: go
2+
os: linux
3+
dist: xenial
24
go:
3-
- "1.11.x"
4-
- "1.12.x"
5-
matrix:
5+
- 1.12.x
6+
- 1.13.x
7+
- 1.14.x
8+
jobs:
69
include:
7-
- go: "1.13.x"
10+
- go: 1.x
811
script:
912
- make ci
1013
after_success:

Makefile

+21-13
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,32 @@
1+
ci: test-cover lint check-tidy
12
.PHONY: ci
2-
ci: testcov lint istidy
33

4-
.PHONY: test
54
test:
65
go test -race ./...
6+
.PHONY: test
77

8-
.PHONY: lint
98
lint:
10-
docker run --rm --name lint -v `pwd`:/app -w /app golangci/golangci-lint:v1.21.0 golangci-lint run
9+
docker run --rm --name lint -v `pwd`:/app -w /app golangci/golangci-lint:v1.24.0 golangci-lint run
10+
.PHONY: lint
1111

12-
.PHONY: tidy
1312
tidy:
1413
go mod tidy
14+
.PHONY: tidy
1515

16-
.PHONY: testcov
17-
testcov:
18-
go test -race -coverpkg ./... -coverprofile=coverage.out ./...
19-
20-
.PHONY: istidy
21-
istidy:
16+
update-deps:
17+
go get -u -t ./...
2218
go mod tidy
23-
if [[ `git status --porcelain go.mod` ]]; then git diff -- go.mod ; echo "go.mod is outdated, please run go mod tidy" ; exit 1; fi
24-
if [[ `git status --porcelain go.sum` ]]; then git diff -- go.sum ; echo "go.sum is outdated, please run go mod tidy" ; exit 1; fi
19+
.PHONY: update-deps
20+
21+
check-tidy:
22+
cp go.mod go.check.mod
23+
cp go.sum go.check.sum
24+
go mod tidy -modfile=go.check.mod
25+
diff -u go.mod go.check.mod
26+
diff -u go.sum go.check.sum
27+
rm go.check.mod go.check.sum
28+
.PHONY: check-tidy
29+
30+
test-cover:
31+
go test -race -coverpkg ./... -coverprofile=coverage.out ./...
32+
.PHONY: test-cover

README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ More detailed articles on this topic:
2424
## Usage
2525

2626
The best way is to use [golangci-lint](https://github.com/golangci/golangci-lint).
27-
It includes **testpackage** linter started from v1.22.0 and higher.
27+
It includes **testpackage** linter started from v1.25.0 and higher.
2828

2929
### Install
3030
See [install section](https://github.com/golangci/golangci-lint#install) of readme.
@@ -91,6 +91,14 @@ Flags: -V print version and exit
9191

9292
## Changelog
9393

94+
### [v1.0.1] - 2020-04-22
95+
96+
#### Changed
97+
* No changes in linter behavior
98+
* Use latest go version on travis-ci
99+
* Update Makefile
100+
* Update golangci-lint
101+
94102
### [v1.0.0] - 2019-11-10
95103

96104
#### Added

go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module github.com/maratori/testpackage
22

3-
go 1.13
3+
go 1.12 // minimal supported version
44

5-
require golang.org/x/tools v0.0.0-20191101200257-8dbcdeb83d3f
5+
require golang.org/x/tools v0.0.0-20200422022333-3d57cf2e726e

go.sum

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
1+
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
12
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
3+
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
4+
golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ=
5+
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
6+
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
27
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
8+
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
39
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
10+
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
411
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
12+
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
513
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
6-
golang.org/x/tools v0.0.0-20191101200257-8dbcdeb83d3f h1:+QO45yvqhfD79HVNFPAgvstYLFye8zA+rd0mHFsGV9s=
7-
golang.org/x/tools v0.0.0-20191101200257-8dbcdeb83d3f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
14+
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
15+
golang.org/x/tools v0.0.0-20200422022333-3d57cf2e726e h1:3Dzrrxi54Io7Aoyb0PYLsI47K2TxkRQg+cqUn+m04do=
16+
golang.org/x/tools v0.0.0-20200422022333-3d57cf2e726e/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
817
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
18+
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
19+
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
20+
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

0 commit comments

Comments
 (0)