forgejo-runner

git clone git://git.lin.moe/forgejo-runner.git

  1linters:
  2  enable:
  3    - gosimple
  4    - typecheck
  5    - govet
  6    - errcheck
  7    - staticcheck
  8    - unused
  9    - dupl
 10    #- gocyclo # The cyclomatic complexety of a lot of functions is too high, we should refactor those another time.
 11    - gofmt
 12    - misspell
 13    - gocritic
 14    - bidichk
 15    - ineffassign
 16    - revive
 17    - gofumpt
 18    - depguard
 19    - nakedret
 20    - unconvert
 21    - wastedassign
 22    - nolintlint
 23    - stylecheck
 24  enable-all: false
 25  disable-all: true
 26  fast: false
 27
 28run:
 29  go: 1.18
 30  timeout: 10m
 31  skip-dirs:
 32    - node_modules
 33    - public
 34    - web_src
 35
 36linters-settings:
 37  stylecheck:
 38    checks: ["all", "-ST1005", "-ST1003"]
 39  nakedret:
 40    max-func-lines: 0
 41  gocritic:
 42    disabled-checks:
 43      - ifElseChain
 44      - singleCaseSwitch # Every time this occurred in the code, there  was no other way.
 45  revive:
 46    ignore-generated-header: false
 47    severity: warning
 48    confidence: 0.8
 49    errorCode: 1
 50    warningCode: 1
 51    rules:
 52      - name: blank-imports
 53      - name: context-as-argument
 54      - name: context-keys-type
 55      - name: dot-imports
 56      - name: error-return
 57      - name: error-strings
 58      - name: error-naming
 59      - name: exported
 60      - name: if-return
 61      - name: increment-decrement
 62      - name: var-naming
 63      - name: var-declaration
 64      - name: package-comments
 65      - name: range
 66      - name: receiver-naming
 67      - name: time-naming
 68      - name: unexported-return
 69      - name: indent-error-flow
 70      - name: errorf
 71      - name: duplicated-imports
 72      - name: modifies-value-receiver
 73  gofumpt:
 74    extra-rules: true
 75    lang-version: "1.18"
 76  depguard:
 77    # TODO: use depguard to replace import checks in gitea-vet
 78    list-type: denylist
 79    # Check the list against standard lib.
 80    include-go-root: true
 81    packages-with-error-message:
 82      - github.com/unknwon/com: "use gitea's util and replacements"
 83
 84issues:
 85  exclude-rules:
 86    # Exclude some linters from running on tests files.
 87    - path: _test\.go
 88      linters:
 89        - gocyclo
 90        - errcheck
 91        - dupl
 92        - gosec
 93        - unparam
 94        - staticcheck
 95    - path: models/migrations/v
 96      linters:
 97        - gocyclo
 98        - errcheck
 99        - dupl
100        - gosec
101    - linters:
102        - dupl
103      text: "webhook"
104    - linters:
105        - gocritic
106      text: "`ID' should not be capitalized"
107    - path: modules/templates/helper.go
108      linters:
109        - gocritic
110    - linters:
111        - unused
112      text: "swagger"
113    - path: contrib/pr/checkout.go
114      linters:
115        - errcheck
116    - path: models/issue.go
117      linters:
118        - errcheck
119    - path: models/migrations/
120      linters:
121        - errcheck
122    - path: modules/log/
123      linters:
124        - errcheck
125    - path: routers/api/v1/repo/issue_subscription.go
126      linters:
127        - dupl
128    - path: routers/repo/view.go
129      linters:
130        - dupl
131    - path: models/migrations/
132      linters:
133        - unused
134    - linters:
135        - staticcheck
136      text: "argument x is overwritten before first use"
137    - path: modules/httplib/httplib.go
138      linters:
139        - staticcheck
140    # Enabling this would require refactoring the methods and how they are called.
141    - path: models/issue_comment_list.go
142      linters:
143        - dupl
144    - linters:
145        - misspell
146      text: '`Unknwon` is a misspelling of `Unknown`'
147    - path: models/update.go
148      linters:
149        - unused
150    - path: cmd/dump.go
151      linters:
152        - dupl
153    - text: "commentFormatting: put a space between `//` and comment text"
154      linters:
155        - gocritic
156    - text: "exitAfterDefer:"
157      linters:
158        - gocritic
159    - path: modules/graceful/manager_windows.go
160      linters:
161        - staticcheck
162      text: "svc.IsAnInteractiveSession is deprecated: Use IsWindowsService instead."
163    - path: models/user/openid.go
164      linters:
165        - golint