Skip to content

Commit 4e53f51

Browse files
authored
docs: update revive configuration (#4790)
1 parent 839b9d7 commit 4e53f51

4 files changed

+290
-100
lines changed

.golangci.next.reference.yml

Lines changed: 62 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1561,8 +1561,8 @@ linters-settings:
15611561
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#atomic
15621562
- name: atomic
15631563
severity: warning
1564-
exclude: [""]
15651564
disabled: false
1565+
exclude: [""]
15661566
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#banned-characters
15671567
- name: banned-characters
15681568
severity: warning
@@ -1572,23 +1572,23 @@ linters-settings:
15721572
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#bare-return
15731573
- name: bare-return
15741574
severity: warning
1575-
exclude: [""]
15761575
disabled: false
1576+
exclude: [""]
15771577
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#blank-imports
15781578
- name: blank-imports
15791579
severity: warning
1580-
exclude: [""]
15811580
disabled: false
1581+
exclude: [""]
15821582
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#bool-literal-in-expr
15831583
- name: bool-literal-in-expr
15841584
severity: warning
1585-
exclude: [""]
15861585
disabled: false
1586+
exclude: [""]
15871587
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#call-to-gc
15881588
- name: call-to-gc
15891589
severity: warning
1590-
exclude: [""]
15911590
disabled: false
1591+
exclude: [""]
15921592
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#cognitive-complexity
15931593
- name: cognitive-complexity
15941594
severity: warning
@@ -1658,6 +1658,7 @@ linters-settings:
16581658
severity: warning
16591659
disabled: false
16601660
exclude: [""]
1661+
arguments: [ ]
16611662
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#duplicated-imports
16621663
- name: duplicated-imports
16631664
severity: warning
@@ -1742,18 +1743,18 @@ linters-settings:
17421743
severity: warning
17431744
disabled: false
17441745
exclude: [""]
1745-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#function-result-limit
1746-
- name: function-result-limit
1747-
severity: warning
1748-
disabled: false
1749-
exclude: [""]
1750-
arguments: [ 2 ]
17511746
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#function-length
17521747
- name: function-length
17531748
severity: warning
17541749
disabled: false
17551750
exclude: [""]
17561751
arguments: [ 10, 0 ]
1752+
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#function-result-limit
1753+
- name: function-result-limit
1754+
severity: warning
1755+
disabled: false
1756+
exclude: [""]
1757+
arguments: [ 3 ]
17571758
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#get-return
17581759
- name: get-return
17591760
severity: warning
@@ -1769,25 +1770,18 @@ linters-settings:
17691770
severity: warning
17701771
disabled: false
17711772
exclude: [""]
1772-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#increment-decrement
1773-
- name: increment-decrement
1774-
severity: warning
1775-
disabled: false
1776-
exclude: [""]
1777-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#indent-error-flow
1778-
- name: indent-error-flow
1779-
severity: warning
1780-
disabled: false
1781-
exclude: [""]
1782-
arguments:
1783-
- "preserveScope"
17841773
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#import-alias-naming
17851774
- name: import-alias-naming
17861775
severity: warning
17871776
disabled: false
17881777
exclude: [""]
17891778
arguments:
17901779
- "^[a-z][a-z0-9]{0,}$"
1780+
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#import-shadowing
1781+
- name: import-shadowing
1782+
severity: warning
1783+
disabled: false
1784+
exclude: [""]
17911785
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#imports-blocklist
17921786
- name: imports-blocklist
17931787
severity: warning
@@ -1796,11 +1790,18 @@ linters-settings:
17961790
arguments:
17971791
- "crypto/md5"
17981792
- "crypto/sha1"
1799-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#import-shadowing
1800-
- name: import-shadowing
1793+
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#increment-decrement
1794+
- name: increment-decrement
1795+
severity: warning
1796+
disabled: false
1797+
exclude: [""]
1798+
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#indent-error-flow
1799+
- name: indent-error-flow
18011800
severity: warning
18021801
disabled: false
18031802
exclude: [""]
1803+
arguments:
1804+
- "preserveScope"
18041805
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#line-length-limit
18051806
- name: line-length-limit
18061807
severity: warning
@@ -1849,23 +1850,18 @@ linters-settings:
18491850
severity: warning
18501851
disabled: false
18511852
exclude: [""]
1852-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#range-val-in-closure
1853-
- name: range-val-in-closure
1854-
severity: warning
1855-
disabled: false
1856-
exclude: [""]
18571853
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#range-val-address
18581854
- name: range-val-address
18591855
severity: warning
18601856
disabled: false
18611857
exclude: [""]
1862-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#receiver-naming
1863-
- name: receiver-naming
1858+
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#range-val-in-closure
1859+
- name: range-val-in-closure
18641860
severity: warning
18651861
disabled: false
18661862
exclude: [""]
1867-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#redundant-import-alias
1868-
- name: redundant-import-alias
1863+
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#receiver-naming
1864+
- name: receiver-naming
18691865
severity: warning
18701866
disabled: false
18711867
exclude: [""]
@@ -1874,8 +1870,8 @@ linters-settings:
18741870
severity: warning
18751871
disabled: false
18761872
exclude: [""]
1877-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#string-of-int
1878-
- name: string-of-int
1873+
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#redundant-import-alias
1874+
- name: redundant-import-alias
18791875
severity: warning
18801876
disabled: false
18811877
exclude: [""]
@@ -1894,14 +1890,19 @@ linters-settings:
18941890
- - panic
18951891
- '/^[^\n]*$/'
18961892
- must not contain line breaks
1893+
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#string-of-int
1894+
- name: string-of-int
1895+
severity: warning
1896+
disabled: false
1897+
exclude: [""]
18971898
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#struct-tag
18981899
- name: struct-tag
1899-
arguments:
1900-
- "json,inline"
1901-
- "bson,outline,gnu"
19021900
severity: warning
19031901
disabled: false
19041902
exclude: [""]
1903+
arguments:
1904+
- "json,inline"
1905+
- "bson,outline,gnu"
19051906
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#superfluous-else
19061907
- name: superfluous-else
19071908
severity: warning
@@ -1919,20 +1920,13 @@ linters-settings:
19191920
severity: warning
19201921
disabled: false
19211922
exclude: [""]
1922-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#var-naming
1923-
- name: var-naming
1923+
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unchecked-type-assertion
1924+
- name: unchecked-type-assertion
19241925
severity: warning
19251926
disabled: false
19261927
exclude: [""]
19271928
arguments:
1928-
- [ "ID" ] # AllowList
1929-
- [ "VM" ] # DenyList
1930-
- - upperCaseConst: true
1931-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#var-declaration
1932-
- name: var-declaration
1933-
severity: warning
1934-
disabled: false
1935-
exclude: [""]
1929+
- acceptIgnoredAssertionResult: true
19361930
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unconditional-recursion
19371931
- name: unconditional-recursion
19381932
severity: warning
@@ -1980,11 +1974,30 @@ linters-settings:
19801974
exclude: [""]
19811975
arguments:
19821976
- allowRegex: "^_"
1977+
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#use-any
1978+
- name: use-any
1979+
severity: warning
1980+
disabled: false
1981+
exclude: [""]
19831982
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#useless-break
19841983
- name: useless-break
19851984
severity: warning
19861985
disabled: false
19871986
exclude: [""]
1987+
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#var-declaration
1988+
- name: var-declaration
1989+
severity: warning
1990+
disabled: false
1991+
exclude: [""]
1992+
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#var-naming
1993+
- name: var-naming
1994+
severity: warning
1995+
disabled: false
1996+
exclude: [""]
1997+
arguments:
1998+
- [ "ID" ] # AllowList
1999+
- [ "VM" ] # DenyList
2000+
- - upperCaseConst: true # Extra parameter (upperCaseConst|skipPackageNameChecks)
19882001
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#waitgroup-by-value
19892002
- name: waitgroup-by-value
19902003
severity: warning

0 commit comments

Comments
 (0)