Skip to content

Commit a0a03b4

Browse files
committed
only lint new issues, add linting to travis run
1 parent 36838cf commit a0a03b4

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

.golangci.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
run:
2+
# timeout for analysis
3+
deadline: 4m
4+
5+
# Linting uses a lot of memory. Keep it under control by only running a single
6+
# worker.
7+
concurrency: 1
8+
9+
linters-settings:
10+
gofmt:
11+
# simplify code: gofmt with `-s` option, true by default
12+
simplify: true
13+
14+
linters:
15+
enable-all: true
16+
disable:
17+
# Global variables are used in many places throughout the code base.
18+
- gochecknoglobals
19+
20+
# Some lines are over 80 characters on purpose and we don't want to make them
21+
# even longer by marking them as 'nolint'.
22+
- lll
23+
24+
# We don't care (enough) about misaligned structs to lint that.
25+
- maligned
26+
27+
# We have long functions, especially in tests. Moving or renaming those would
28+
# trigger funlen problems that we may not want to solve at that time.
29+
- funlen
30+
31+
# Disable for now as we haven't yet tuned the sensitivity to our codebase
32+
# yet. Enabling by default for example, would also force new contributors to
33+
# potentially extensively refactor code, when they want to smaller change to
34+
# land.
35+
- gocyclo
36+
37+
# Instances of table driven tests that don't pre-allocate shouldn't trigger
38+
# the linter.
39+
- prealloc
40+
41+
issues:
42+
# Only show newly introduced problems.
43+
new-from-rev: 36838cf7f464cf73b0201798063b2caffeae4250

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ sudo: required
1818

1919
script:
2020
- export GO111MODULE=on
21-
- make unit
21+
- make lint unit
2222

2323
after_script:
2424
- echo "Uploading to termbin.com..." && find *.log | xargs -I{} sh -c "cat {} | nc termbin.com 9999 | xargs -r0 printf '{} uploaded to %s'"

0 commit comments

Comments
 (0)