From f27364f46754863219c40ca61ae1e6cc9426432b Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Mon, 24 Oct 2022 22:16:39 +0800 Subject: [PATCH] golangci: customize `dupl`, `funlen`, `nestif`, and `nlreturn` [skip ci] --- .golangci.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 06c4865ca..4ad0b273b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -61,11 +61,22 @@ linters-settings: funlen: # Checks the number of lines in a function. # If lower than 0, disable the check. - # Default: 60 - lines: 60 + lines: 200 # Checks the number of statements in a function. - # Default: 40 - statements: 40 + statements: 80 + + dupl: + # Tokens count to trigger issue. + threshold: 200 + + nestif: + # Minimal complexity of if statements to report. + min-complexity: 10 + + nlreturn: + # Size of the block (including return statement that is still "OK") + # so no return split required. + block-size: 3 linters: