X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/8012e7aa157a1e784b1b1a73ad4c41bb1d00c582..a3b9849a54a6cd8a4cc5b1ae03a39aab31322f7b:/.golangci.yml diff --git a/.golangci.yml b/.golangci.yml index 082c4f4..d5f20b3 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -5,3 +5,36 @@ linters: enable: - errorlint - gocritic + - testifylint + - revive + - wrapcheck + - nlreturn + settings: + nlreturn: + # go-code: Keep a short declaration with its immediate use. + block-size: 2 + wrapcheck: + # go-code: Return ctx.Err() directly. + extra-ignore-sigs: + - "(context.Context).Err() error" + exclusions: + rules: + # go-code: A function with one error path can return it directly. + - linters: [wrapcheck] + path: ^records\.go$ + source: 'return r\.file\.Close\(\)' + - linters: [wrapcheck] + path: ^log_test\.go$ + source: 'return os\.Truncate\(' + - linters: [wrapcheck] + path: ^sync_buffer_helper_test\.go$ + source: 'return b\.buffer\.Write\(' + - linters: [wrapcheck] + path: ^probe\.go$ + source: 'return s\.inner\.Summarize\(' + - linters: [wrapcheck] + path: ^view\.go$ + source: 'return false, err' + - linters: [wrapcheck] + path: ^whatsapp\.go$ + text: 'sqlstore\.Container\)\.Close\('