Commit Graph

21 Commits

Author SHA1 Message Date
Dmitry Vyukov
c992206a1d tools/syz-linter: add custom linter
For now we have 2 simple checks:

1. for multiline comments:
/* */ -> //

2. for string len comparison with 0:
len(str) != 0 -> str != ""

Update #1876
2020-07-04 15:05:30 +02:00
Dmitry Vyukov
2c2b926cb7 .golangci.yml: reduce function line count from 200 to 140
140 lines should be enough for everyone.
2020-06-07 10:41:01 +02:00
Dmitry Vyukov
3f04838a10 .golangci.yml: make goconst checker more strict 2020-06-07 10:41:01 +02:00
Dmitry Vyukov
cdf1aa4dc3 pkg/report: deduplicate code across netbsd and openbsd 2020-06-07 10:41:01 +02:00
Dmitry Vyukov
21b79583f1 .golangci.yml: enable receiver name check for pkg/ast 2020-06-07 10:41:01 +02:00
Dmitry Vyukov
70854cd639 .golangci.yml: enable lll for pkg/report/linux.go 2020-06-07 10:41:01 +02:00
Dmitry Vyukov
0e2e52a87a .golangci.yml: reduce scope of suppressions
Reduce scope of some suppressions (some are violated only in some packages).
Remove some outdated, fix and enable the type switch warning.
2020-06-07 10:41:01 +02:00
Dmitry Vyukov
48b44e1ce0 .golangci.yml: reenable dupl checker
At some point it was enabled, but then somehow got disabled.
Re-enable and fix some regressions.
2020-06-05 12:23:19 +02:00
Dmitry Vyukov
2b2857bd21 .golangci.yml: enable funlen checker
Checks for too long functions (based on lines and statements).
2020-06-05 12:23:19 +02:00
Dmitry Vyukov
2fcb2b5c16 .golangci.yml: enable gocognit checker
Finds too complex functions.
Similar to gocyclo, but uses somewhat different metric.
2020-06-05 12:23:19 +02:00
Dmitry Vyukov
e3d77cf2a3 .golangci.yml: enable godot checker
A good one. Lots of fixed comments are contributed by episodic contributors.
So it's good to catch these earlier.
2020-06-05 12:23:19 +02:00
Dmitry Vyukov
26ae0a0edd .golangci.yml: enable goprintffuncname checker
Only 1 warning. Good to fix and enable before we get more.
2020-06-05 12:23:19 +02:00
Dmitry Vyukov
4ac8a30aa8 .golangci.yml: explicitly list disabled checkers
These are disabled by default, so this does not change behavior.
But it's good to see whole list and this makes it clear
that they are not missed accidentially.
2020-06-05 12:23:19 +02:00
Dmitry Vyukov
6c22a3d2dd .golangci.yml: enable nestif checker
Prevents functions with too many nested if's.
2020-06-05 12:23:19 +02:00
Dmitry Vyukov
503fd5b2f7 .golangci.yml: enable whitespace checker
Points to bad empty lines very precisely.
2020-06-05 12:23:19 +02:00
Dmitry Vyukov
05359321bb all: fix new golangci-lint warnings
Newer version started producing more warnings. Fix them.
2020-03-13 08:26:02 +01:00
Dmitry Vyukov
0f33548a39 tools/syz-trace2syz: disable golangci-lint
A new version of golangci-lint started failing trying to build syz-trace2syz
(because we already ignore some files).
Ignore the rest of files to fix the failure.
2019-10-08 12:31:54 +02:00
Veronica Radu
13dcda9b39 updated golangci.yml to exclude new errors 2019-09-17 13:02:55 +02:00
Dmitry Vyukov
01d1494471 .golangci.yml: add codeanalysis build tag
Using a build tag to exclude files for golangci-lint
reduces memory consumption (it does not parse them).
The naive attempt with skip-dirs did not work.
So add codeanalysis build tag and use it in auto-generated files.

Update #977
2019-05-15 11:39:31 +02:00
Dmitry Vyukov
51fc038380 .golangci.yml: update
Enable more linters.
Tune settings for existings.
Fix excludes.

Update #977
2019-04-23 17:58:54 +03:00
Dmitry Vyukov
14c58f8d23 .golangci.yml: add golangci-lint config
Update #977
2019-03-28 15:31:54 +01:00