From 87cdb2ddf9c12cf4da1319bf98d952c987ee4fc5 Mon Sep 17 00:00:00 2001 From: Sebastien Rosset Date: Fri, 18 Dec 2020 02:35:30 -0800 Subject: [PATCH] Add settings examples for gocritic (#1562) --- .golangci.example.yml | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/.golangci.example.yml b/.golangci.example.yml index c1a2e831..c994edc3 100644 --- a/.golangci.example.yml +++ b/.golangci.example.yml @@ -149,11 +149,44 @@ linters-settings: disabled-tags: - experimental - settings: # settings passed to gocritic + # Settings passed to gocritic. + # The settings key is the name of a supported gocritic checker. + # The list of supported checkers can be find in https://go-critic.github.io/overview. + settings: captLocal: # must be valid enabled check name - paramsOnly: true + # whether to restrict checker to params only (default true) + paramsOnly: true + elseif: + # whether to skip balanced if-else pairs (default true) + skipBalanced: true + hugeParam: + # size in bytes that makes the warning trigger (default 80) + sizeThreshold: 80 + nestingReduce: + # min number of statements inside a branch to trigger a warning (default 5) + bodyWidth: 5 + rangeExprCopy: + # size in bytes that makes the warning trigger (default 512) + sizeThreshold: 512 + # whether to check test functions (default true) + skipTestFuncs: true rangeValCopy: + # size in bytes that makes the warning trigger (default 128) sizeThreshold: 32 + # whether to check test functions (default true) + skipTestFuncs: true + ruleguard: + # path to a gorules file for the ruleguard checker + rules: '' + truncateCmp: + # whether to skip int/uint/uintptr types (default true) + skipArchDependent: true + underef: + # whether to skip (*x).method() calls where x is a pointer receiver (default true) + skipRecvDeref: true + unnamedResult: + # whether to check exported functions + checkExported: true gocyclo: # minimal code complexity to report, 30 by default (but we recommend 10-20) min-complexity: 10