# Copyright 2019 syzkaller project authors. All rights reserved. # Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. version: "2" run: timeout: 8m # Autogenerated files take too much time and memory to load, # even if we skip them with issues.exclude-dirs. # So we define this tag and use it in the autogenerated files. build-tags: - codeanalysis output: formats: text: print-issued-lines: false formatters: enable: - gofmt disable: - goimports linters: enable: # keep-sorted start - dupl - errorlint - funlen - gocognit - goconst - gocyclo - godot - goprintffuncname - govet - lll - misspell - nestif - nolintlint - recvcheck - revive - staticcheck - syz-linter - unconvert - unused - whitespace # keep-sorted end disable: # keep-sorted start - bodyclose - depguard - dogsled # errcheck would be good to enable, but we need to fix existing warnings first. - errcheck - gochecknoglobals - gochecknoinits - gocritic - godox - gomodguard - gosec - ineffassign - nakedret - prealloc - rowserrcheck - testpackage - unparam - wsl # keep-sorted end settings: # keep-sorted start block=yes custom: syz-linter: path: bin/syz-linter.so dupl: threshold: 60 errorlint: comparison: false # we want to use "err == iterator.Done" funlen: # TODO: consider reducing these value. lines: 140 statements: 80 gocognit: # TODO: consider reducing this value. min-complexity: 70 goconst: min-len: 3 min-occurrences: 3 ignore-string-values: ['\.html|^true$'] gocyclo: # TODO: consider reducing this value. min-complexity: 24 godot: scope: toplevel exclude: ["keep-sorted"] lll: line-length: 120 nestif: # TODO: consider reducing this value. min-complexity: 12 nolintlint: allow-unused: false require-specific: true revive: rules: - name: package-comments disabled: true - name: argument-limit arguments: [ 7 ] staticcheck: checks: - all - -ST1000 # at least one file in a package should have a package comment - -ST1020 # comment on exported function Foo should be of the form "Foo ..." - -ST1021 # comment on exported type Foo should be of the form "Foo ..." (with optional leading article) - -ST1022 # comment on exported const Foo should be of the form "Foo ..." - -QF1008 # could remove embedded field "..." from selector # keep-sorted end exclusions: warn-unused: true # Log a warning if an exclusion path is unused. rules: - path: (.*\.go) text: "directive `// nolint:.*` should be written without leading space" - path: (sys/.*/init.*|sys/targets/common.go) text: "don't use ALL_CAPS in Go names|should not use ALL_CAPS in Go names" - path: (prog/.*) text: "methods on the same type should have the same receiver name" - path: (dashboard/app/.*_test\.go) linters: - dupl - path: (prog/.*_test\.go) linters: - goconst - path: (.*_test\.go) text: "Function '.*' is too long" - path: tools/syz-trace2syz linters: - unused - syz-linter - godot - path: sys/register.go linters: - whitespace # TODO: fix the code generation - path: (.*_test.go) linters: - goconst issues: max-same-issues: 0