golangci-lint.yaml 1.5 KB

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