Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
148 changes: 148 additions & 0 deletions .golangci.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ linters:
- goconst
- gocritic
- gocyclo
- godoclint
- godot
- godox
- goheader
Expand All @@ -75,6 +76,7 @@ linters:
- ineffassign
- interfacebloat
- intrange
- iotamixing
- ireturn
- lll
- loggercheck
Expand Down Expand Up @@ -118,6 +120,7 @@ linters:
- tparallel
- unconvert
- unparam
- unqueryvet
- unused
- usestdlibvars
- usetesting
Expand Down Expand Up @@ -170,6 +173,7 @@ linters:
- goconst
- gocritic
- gocyclo
- godoclint
- godot
- godox
- goheader
Expand All @@ -186,6 +190,7 @@ linters:
- ineffassign
- interfacebloat
- intrange
- iotamixing
- ireturn
- lll
- loggercheck
Expand Down Expand Up @@ -229,6 +234,7 @@ linters:
- tparallel
- unconvert
- unparam
- unqueryvet
- unused
- usestdlibvars
- usetesting
Expand Down Expand Up @@ -392,6 +398,9 @@ linters:
- "0C0C"

embeddedstructfieldcheck:
# Checks that there is an empty space between the embedded fields and regular fields.
# Default: true
empty-line: false
# Checks that sync.Mutex and sync.RWMutex are not used as embedded fields.
# Default: false
forbid-mutex: true
Expand Down Expand Up @@ -654,6 +663,10 @@ linters:
# Default: false
force-assertion-description: true

# Force using `ToNot`, `ShouldNot` instead of `To(Not())`.
# Default: false
force-tonot: true

gochecksumtype:
# Presence of `default` case in switch statements satisfies exhaustiveness, if all members are not listed.
# Default: true
Expand Down Expand Up @@ -1263,6 +1276,74 @@ linters:
# Default: 30 (but we recommend 10-20)
min-complexity: 10

godoclint:
# Default set of rules to enable.
# Possible values are: `basic`, `all` or `none`.
# Default: `basic` (enables `pkg-doc`, `single-pkg-doc`, `start-with-name`, and `deprecated`)
default: all

# List of rules to enable in addition to the default set.
# Default: empty
enable:
# Check proper package-level godoc, if any.
# https://github.com/godoc-lint/godoc-lint?tab=readme-ov-file#pkg-doc
- pkg-doc
# Assert at most one godoc per package.
# https://github.com/godoc-lint/godoc-lint?tab=readme-ov-file#single-pkg-doc
- single-pkg-doc
# Require all packages to have a godoc.
# https://github.com/godoc-lint/godoc-lint?tab=readme-ov-file#require-pkg-doc
- require-pkg-doc
# Assert symbol godocs start with the symbol name.
# https://github.com/godoc-lint/godoc-lint?tab=readme-ov-file#start-with-name
- start-with-name
# Require godoc for all public symbols.
# https://github.com/godoc-lint/godoc-lint?tab=readme-ov-file#require-doc
- require-doc
# Assert correct formatting of deprecation notes.
# https://github.com/godoc-lint/godoc-lint?tab=readme-ov-file#deprecated
- deprecated
# Assert maximum line length for godocs.
# https://github.com/godoc-lint/godoc-lint?tab=readme-ov-file#max-len
- max-len
# Assert no unused link in godocs.
# https://github.com/godoc-lint/godoc-lint?tab=readme-ov-file#no-unused-link
- no-unused-link

# List of rules to disable.
# Default: empty
disable:
- pkg-doc
- single-pkg-doc
- require-pkg-doc
- start-with-name
- require-doc
- deprecated
- max-len
- no-unused-link

# A map for fine-tuning individual rules.
# All subkeys are optional.
options:
max-len:
# Maximum line length for godocs, not including the `// `, or `/*` or `*/` tokens.
# Default: 77
length: 127

require-doc:
# Ignore exported (public) symbols when applying the `require-doc` rule.
# Default: false
ignore-exported: true

# Ignore unexported (private) symbols when applying the `require-doc` rule.
# Default: true
ignore-unexported: false

start-with-name:
# Include unexported symbols when applying the `start-with-name` rule.
# Default: false
include-unexported: true

godot:
# Comments to be checked: `declarations`, `toplevel`, `noinline` or `all`.
# Default: declarations
Expand Down Expand Up @@ -1870,11 +1951,21 @@ linters:
# Default: false
skip-single-param: true

ineffassign:
# Check escaping variables of type error, may cause false positives.
# Default: false
check-escaping-errors: true

interfacebloat:
# The maximum number of methods allowed for an interface.
# Default: 10
max: 5

iotamixing:
# Whether to report individual consts rather than just the const block.
# Default: false
report-individual: true

ireturn:
# List of interfaces to allow.
# Lists of the keywords and regular expressions matched to interface or package names can be used.
Expand Down Expand Up @@ -2510,6 +2601,26 @@ linters:
severity: warning
disabled: false
exclude: [""]
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#identical-ifelseif-branches
- name: identical-ifelseif-branches
severity: warning
disabled: false
exclude: [""]
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#identical-ifelseif-conditions
- name: identical-ifelseif-conditions
severity: warning
disabled: false
exclude: [""]
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#identical-switch-branches
- name: identical-switch-branches
severity: warning
disabled: false
exclude: [""]
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#identical-switch-conditions
- name: identical-switch-conditions
severity: warning
disabled: false
exclude: [""]
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#if-return
- name: if-return
severity: warning
Expand Down Expand Up @@ -2593,6 +2704,13 @@ linters:
severity: warning
disabled: false
exclude: [""]
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#package-directory-mismatch
- name: package-directory-mismatch
severity: warning
disabled: false
exclude: [""]
arguments:
- ignore-directories: ["testcases", "testinfo"]
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#range
- name: range
severity: warning
Expand Down Expand Up @@ -2730,6 +2848,11 @@ linters:
severity: warning
disabled: false
exclude: [""]
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unsecure-url-scheme
- name: unsecure-url-scheme
severity: warning
disabled: false
exclude: [""]
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unused-parameter
- name: unused-parameter
severity: warning
Expand Down Expand Up @@ -2759,11 +2882,21 @@ linters:
severity: warning
disabled: false
exclude: [""]
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#use-waitgroup-go
- name: use-waitgroup-go
severity: warning
disabled: false
exclude: [""]
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#useless-break
- name: useless-break
severity: warning
disabled: false
exclude: [""]
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#useless-fallthrough
- name: useless-fallthrough
severity: warning
disabled: false
exclude: [""]
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#var-declaration
- name: var-declaration
severity: warning
Expand Down Expand Up @@ -3757,6 +3890,21 @@ linters:
# Default: false
check-exported: true

unqueryvet:
# Enable SQL builder checking.
# Default: true
check-sql-builders: false
# Regex patterns for acceptable SELECT * usage.
# Default:
# - "SELECT \\* FROM information_schema\\..*"
# - "SELECT \\* FROM pg_catalog\\..*"
# - "SELECT COUNT\\(\\*\\)"
# - "SELECT MAX\\(\\*\\)"
# - "SELECT MIN\\(\\*\\)"
allowed-patterns:
- "SELECT \\* FROM temp_.*"
- "SELECT \\* FROM.*-- migration"

unused:
# Mark all struct fields that have been written to as used.
# Default: true
Expand Down
31 changes: 29 additions & 2 deletions docs/data/linters_info.json
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,15 @@
"isSlow": false,
"since": "v1.0.0"
},
{
"name": "godoclint",
"desc": "Checks Golang's documentation practice (godoc)",
"loadMode": 8199,
"originalURL": "https://github.com/godoc-lint/godoc-lint",
"internal": false,
"isSlow": false,
"since": "v2.5.0"
},
{
"name": "godot",
"desc": "Check if comments end in a period",
Expand Down Expand Up @@ -497,7 +506,7 @@
},
{
"name": "ineffassign",
"desc": "Detects when assignments to existing variables are not used",
"desc": "detects when assignments to existing variables are not used",
"groups": [
"standard"
],
Expand Down Expand Up @@ -526,6 +535,15 @@
"isSlow": true,
"since": "v1.57.0"
},
{
"name": "iotamixing",
"desc": "checks if iotas are being used in const blocks with other non-iota declarations.",
"loadMode": 8199,
"originalURL": "https://github.com/AdminBenni/iota-mixing",
"internal": false,
"isSlow": false,
"since": "v2.5.0"
},
{
"name": "ireturn",
"desc": "Accept Interfaces, Return Concrete Types",
Expand Down Expand Up @@ -874,7 +892,7 @@
},
{
"name": "thelper",
"desc": "thelper detects tests helpers which is not start with t.Helper() method.",
"desc": "thelper detects tests helpers which do not start with the t.Helper() method.",
"loadMode": 8767,
"originalURL": "https://github.com/kulti/thelper",
"internal": false,
Expand Down Expand Up @@ -916,6 +934,15 @@
"isSlow": true,
"since": "v1.9.0"
},
{
"name": "unqueryvet",
"desc": "detects SELECT * in SQL queries and SQL builders, preventing performance issues and encouraging explicit column selection",
"loadMode": 8199,
"originalURL": "https://github.com/MirrexOne/unqueryvet",
"internal": false,
"isSlow": false,
"since": "v2.5.0"
},
{
"name": "unused",
"desc": "Checks Go code for unused constants, variables, functions and types",
Expand Down
24 changes: 24 additions & 0 deletions docs/data/thanks.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
"profile": "https://github.com/sponsors/Abirdcfly",
"avatar": "https://github.com/Abirdcfly.png"
},
{
"name": "AdminBenni",
"linters": [
"iotamixing"
],
"profile": "https://github.com/sponsors/AdminBenni",
"avatar": "https://github.com/AdminBenni.png"
},
{
"name": "alecthomas",
"linters": [
Expand Down Expand Up @@ -69,6 +77,14 @@
"profile": "https://github.com/sponsors/ashanbrown",
"avatar": "https://github.com/ashanbrown.png"
},
{
"name": "babakks",
"linters": [
"godoclint"
],
"profile": "https://github.com/sponsors/babakks",
"avatar": "https://github.com/babakks.png"
},
{
"name": "bkielbasa",
"linters": [
Expand Down Expand Up @@ -426,6 +442,14 @@
"profile": "https://github.com/sponsors/mibk",
"avatar": "https://github.com/mibk.png"
},
{
"name": "MirrexOne",
"linters": [
"unqueryvet"
],
"profile": "https://github.com/sponsors/MirrexOne",
"avatar": "https://github.com/MirrexOne.png"
},
{
"name": "moricho",
"linters": [
Expand Down
Loading
Loading