.golangci.yaml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. run:
  2. timeout: 10m
  3. linters:
  4. enable:
  5. - errcheck
  6. - goimports
  7. - revive
  8. - govet
  9. - staticcheck
  10. - misspell
  11. - gocritic
  12. - sqlclosecheck
  13. - rowserrcheck
  14. - nilerr
  15. - godot
  16. - forbidigo
  17. - mirror
  18. - bodyclose
  19. issues:
  20. include:
  21. # https://golangci-lint.run/usage/configuration/#command-line-options
  22. exclude:
  23. - Rollback
  24. - fmt.Printf
  25. linters-settings:
  26. goimports:
  27. # Put imports beginning with prefix after 3rd-party packages.
  28. local-prefixes: github.com/usememos/memos
  29. revive:
  30. # Default to run all linters so that new rules in the future could automatically be added to the static check.
  31. enable-all-rules: true
  32. rules:
  33. # The following rules are too strict and make coding harder. We do not enable them for now.
  34. - name: file-header
  35. disabled: true
  36. - name: line-length-limit
  37. disabled: true
  38. - name: function-length
  39. disabled: true
  40. - name: max-public-structs
  41. disabled: true
  42. - name: function-result-limit
  43. disabled: true
  44. - name: banned-characters
  45. disabled: true
  46. - name: argument-limit
  47. disabled: true
  48. - name: cognitive-complexity
  49. disabled: true
  50. - name: cyclomatic
  51. disabled: true
  52. - name: confusing-results
  53. disabled: true
  54. - name: add-constant
  55. disabled: true
  56. - name: flag-parameter
  57. disabled: true
  58. - name: nested-structs
  59. disabled: true
  60. - name: import-shadowing
  61. disabled: true
  62. - name: early-return
  63. disabled: true
  64. - name: use-any
  65. disabled: true
  66. - name: exported
  67. disabled: true
  68. - name: unhandled-error
  69. disabled: true
  70. - name: if-return
  71. disabled: true
  72. - name: max-control-nesting
  73. disabled: true
  74. gocritic:
  75. disabled-checks:
  76. - ifElseChain
  77. govet:
  78. settings:
  79. printf: # The name of the analyzer, run `go tool vet help` to see the list of all analyzers
  80. funcs: # Run `go tool vet help printf` to see the full configuration of `printf`.
  81. - common.Errorf
  82. enable-all: true
  83. disable:
  84. - fieldalignment
  85. - shadow
  86. forbidigo:
  87. forbid:
  88. - 'fmt\.Errorf(# Please use errors\.Wrap\|Wrapf\|Errorf instead)?'
  89. - 'ioutil\.ReadDir(# Please use os\.ReadDir)?'