linters: disable-all: true enable: # - telegraflinter - asciicheck - asasalint - bidichk - bodyclose - dogsled - exportloopref - errcheck - goprintffuncname - gosimple - govet - ineffassign - nakedret - nilerr - predeclared - revive - sqlclosecheck - staticcheck - tparallel - typecheck - unconvert - unused linters-settings: revive: rules: - name: argument-limit arguments: [ 6 ] - name: atomic - name: bare-return - name: blank-imports - name: bool-literal-in-expr - name: call-to-gc - name: confusing-naming - name: confusing-results - name: constant-logical-expr - name: context-as-argument - name: context-keys-type - name: deep-exit - name: defer - name: dot-imports - name: duplicated-imports - name: early-return - name: empty-block - name: empty-lines - name: error-naming - name: error-return - name: error-strings - name: errorf # - name: flag-parameter #disable for now - name: function-result-limit arguments: [ 3 ] - name: identical-branches - name: if-return - name: imports-blacklist arguments: [ "log" ] - name: import-shadowing - name: increment-decrement - name: indent-error-flow - name: modifies-parameter - name: modifies-value-receiver - name: package-comments - name: range - name: range-val-address - name: range-val-in-closure - name: receiver-naming - name: redefines-builtin-id - name: string-of-int - name: struct-tag - name: superfluous-else - name: time-naming - name: unconditional-recursion - name: unexported-naming - name: unhandled-error arguments: [ "outputBuffer.Write", "fmt.Printf", "fmt.Println", "fmt.Print", "fmt.Fprintf", "fmt.Fprint", "fmt.Fprintln" ] - name: unnecessary-stmt - name: unreachable-code # - name: unused-parameter - name: var-declaration - name: var-naming - name: waitgroup-by-value nakedret: # make an issue if func has more lines of code than this setting and it has naked returns; default is 30 max-func-lines: 1 run: # timeout for analysis, e.g. 30s, 5m, default is 1m timeout: 10m # which dirs to skip: issues from them won't be reported; # can use regexp here: generated.*, regexp is applied on full path; # default value is empty list, but default dirs are skipped independently # from this option's value (see skip-dirs-use-default). # "/" will be replaced by current OS file path separator to properly work # on Windows. skip-dirs: - assets - docs - etc - scripts # - plugins/parsers/influx/machine.go # which files to skip: they will be analyzed, but issues from them # won't be reported. Default value is empty list, but there is # no need to include all autogenerated files, we confidently recognize # autogenerated files. If it's not please let us know. # "/" will be replaced by current OS file path separator to properly work # on Windows. skip-files: - plugins/parsers/influx/machine.go* issues: # Maximum issues count per one linter. Set to 0 to disable. Default is 50. max-issues-per-linter: 0 # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. max-same-issues: 0 exclude: - don't use an underscore in package name #revive:var-naming exclude-rules: - path: plugins/parsers/influx linters: - govet - path: _test\.go text: "parameter.*seems to be a control flag, avoid control coupling" - path: (^agent/|^cmd/|^config/|^filter/|^internal/|^logger/|^metric/|^models/|^selfstat/|^testutil/|^tools|^plugins/serializers/|^plugins/inputs/zipkin/cmd) text: "imports-blacklist: should not use the following blacklisted import: \"log\"" linters: - revive - path: cmd/telegraf/(main|printer).go text: "Error return value of `outputBuffer.Write` is not checked" output: format: tab