81 lines
1.8 KiB
YAML
81 lines
1.8 KiB
YAML
#
|
|
# Copied from https://github.com/go-gitea/gitea/blob/cc649f0cb338a085373fd85a8b71e315701cbdc1/.golangci.yml
|
|
#
|
|
linters:
|
|
enable:
|
|
- gosimple
|
|
- typecheck
|
|
- govet
|
|
- errcheck
|
|
- staticcheck
|
|
#- unused # disabled because it gets it wrong with golangci-lint@v1.51.2 run & go 1.20.3
|
|
- gofmt
|
|
- misspell
|
|
- gocritic
|
|
- bidichk
|
|
- ineffassign
|
|
- revive
|
|
- gofumpt
|
|
- depguard
|
|
- nakedret
|
|
- unconvert
|
|
- wastedassign
|
|
- nolintlint
|
|
- stylecheck
|
|
enable-all: false
|
|
disable-all: true
|
|
fast: false
|
|
|
|
run:
|
|
go: 1.22
|
|
timeout: 10m
|
|
|
|
issues:
|
|
exclude-dirs:
|
|
- forges/forgejo/sdk
|
|
|
|
linters-settings:
|
|
stylecheck:
|
|
checks: ["all", "-ST1005", "-ST1003"]
|
|
nakedret:
|
|
max-func-lines: 0
|
|
gocritic:
|
|
disabled-checks:
|
|
- ifElseChain
|
|
- singleCaseSwitch # Every time this occurred in the code, there was no other way.
|
|
revive:
|
|
ignore-generated-header: false
|
|
severity: warning
|
|
confidence: 0.8
|
|
errorCode: 1
|
|
warningCode: 1
|
|
rules:
|
|
- name: blank-imports
|
|
- name: context-as-argument
|
|
- name: context-keys-type
|
|
- name: dot-imports
|
|
- name: error-return
|
|
- name: error-strings
|
|
- name: error-naming
|
|
- name: if-return
|
|
- name: increment-decrement
|
|
- name: var-naming
|
|
- name: var-declaration
|
|
- name: package-comments
|
|
- name: range
|
|
- name: receiver-naming
|
|
- name: time-naming
|
|
- name: unexported-return
|
|
- name: indent-error-flow
|
|
- name: errorf
|
|
- name: duplicated-imports
|
|
- name: modifies-value-receiver
|
|
depguard:
|
|
#list-type: denylist
|
|
# Check the list against standard lib.
|
|
#include-go-root: true
|
|
rules:
|
|
main:
|
|
deny:
|
|
- pkg: io/ioutil
|
|
desc: use os or io instead
|