golangci-lint.yaml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. ---
  2. run:
  3. timeout: 5m
  4. issues-exit-code: 1
  5. build-tags:
  6. - codeanalysis
  7. issues:
  8. new-from-rev: origin/master # default: HEAD, this will only show linting changes in the current change
  9. exclude-use-default: false
  10. linters-settings:
  11. revive:
  12. rules:
  13. - name: exported
  14. severity: error
  15. gocyclo:
  16. min-complexity: 40 # should drop to 15 max
  17. gomoddirectives:
  18. replace-local: false
  19. gosec:
  20. excludes:
  21. - G307 # exclude duplicated errcheck checks
  22. linters:
  23. # disable all default-enabled linters so nothing is mysterious
  24. disable-all: true
  25. # all enabled linters found at https://golangci-lint.run/usage/linters/
  26. enable:
  27. - errcheck
  28. - gosimple
  29. - govet
  30. - ineffassign
  31. - staticcheck
  32. - typecheck
  33. - unused
  34. - whitespace
  35. - unparam
  36. - unconvert
  37. - goconst
  38. - misspell
  39. - revive
  40. - gofumpt
  41. - gocyclo
  42. - gomoddirectives
  43. - gosec
  44. output:
  45. # colored-line-number|line-number|json|tab|checkstyle|code-climate|junit-xml|github-actions
  46. # default is "colored-line-number"
  47. format: colored-line-number
  48. # print lines of code with issue, default is true
  49. print-issued-lines: true
  50. # print linter name in the end of issue text, default is true
  51. print-linter-name: true
  52. # make issues output unique by line, default is true
  53. uniq-by-line: true
  54. # add a prefix to the output file references; default is no prefix
  55. path-prefix: ""
  56. # sorts results by: filepath, line and column
  57. sort-results: false