Skip to content

Commit 2987971

Browse files
[create-pull-request] automated change
1 parent e2e4002 commit 2987971

File tree

4 files changed

+158
-35
lines changed

4 files changed

+158
-35
lines changed

.golangci.reference.yml

Lines changed: 74 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,6 +1320,9 @@ linters:
13201320
# Assert no unused link in godocs.
13211321
# https://github.com/godoc-lint/godoc-lint?tab=readme-ov-file#no-unused-link
13221322
- no-unused-link
1323+
# Require proper doc links to standard library declarations where applicable.
1324+
# https://github.com/godoc-lint/godoc-lint?tab=readme-ov-file#require-stdlib-doclink
1325+
- require-stdlib-doclink
13231326

13241327
# List of rules to disable.
13251328
# Default: empty
@@ -1332,12 +1335,13 @@ linters:
13321335
- deprecated
13331336
- max-len
13341337
- no-unused-link
1338+
- require-stdlib-doclink
13351339

13361340
# A map for fine-tuning individual rules.
13371341
# All subkeys are optional.
13381342
options:
13391343
max-len:
1340-
# Maximum line length for godocs, not including the `// `, or `/*` or `*/` tokens.
1344+
# Maximum line length for godocs, not including the `//`, `/*` or `*/` tokens.
13411345
# Default: 77
13421346
length: 127
13431347

@@ -1453,6 +1457,9 @@ linters:
14531457
# Defines a pattern to validate `go` minimum version directive.
14541458
# Default: '' (no match)
14551459
go-version-pattern: '\d\.\d+(\.0)?'
1460+
# Check the validity of the module path.
1461+
# Default: false
1462+
check-module-path: true
14561463

14571464
gomodguard:
14581465
allowed:
@@ -1493,89 +1500,91 @@ linters:
14931500
# Available rules: https://github.com/securego/gosec#available-rules
14941501
# Default: [] - means include all rules
14951502
includes:
1496-
- G101 # Look for hard coded credentials
1503+
- G101 # Look for hardcoded credentials
14971504
- G102 # Bind to all interfaces
14981505
- G103 # Audit the use of unsafe block
14991506
- G104 # Audit errors not checked
1500-
- G106 # Audit the use of ssh.InsecureIgnoreHostKey
1507+
- G106 # Audit the use of ssh.InsecureIgnoreHostKey function
15011508
- G107 # Url provided to HTTP request as taint input
1502-
- G108 # Profiling endpoint automatically exposed on /debug/pprof
1503-
- G109 # Potential Integer overflow made by strconv.Atoi result conversion to int16/32
1504-
- G110 # Potential DoS vulnerability via decompression bomb
1505-
- G111 # Potential directory traversal
1506-
- G112 # Potential slowloris attack
1509+
- G108 # Profiling endpoint is automatically exposed
1510+
- G109 # Converting strconv.Atoi result to int32/int16
1511+
- G110 # Detect io.Copy instead of io.CopyN when decompression
1512+
- G111 # Detect http.Dir('/') as a potential risk
1513+
- G112 # Detect ReadHeaderTimeout not configured as a potential risk
15071514
- G114 # Use of net/http serve function that has no support for setting timeouts
1508-
- G115 # Potential integer overflow when converting between integer types
1515+
- G115 # Type conversion which leads to integer overflow
1516+
- G116 # Detect Trojan Source attacks using bidirectional Unicode characters
15091517
- G201 # SQL query construction using format string
15101518
- G202 # SQL query construction using string concatenation
15111519
- G203 # Use of unescaped data in HTML templates
15121520
- G204 # Audit use of command execution
15131521
- G301 # Poor file permissions used when creating a directory
1514-
- G302 # Poor file permissions used with chmod
1522+
- G302 # Poor file permissions used when creation file or using chmod
15151523
- G303 # Creating tempfile using a predictable path
15161524
- G304 # File path provided as taint input
1517-
- G305 # File traversal when extracting zip/tar archive
1518-
- G306 # Poor file permissions used when writing to a new file
1525+
- G305 # File path traversal when extracting zip archive
1526+
- G306 # Poor file permissions used when writing to a file
15191527
- G307 # Poor file permissions used when creating a file with os.Create
15201528
- G401 # Detect the usage of MD5 or SHA1
15211529
- G402 # Look for bad TLS connection settings
15221530
- G403 # Ensure minimum RSA key length of 2048 bits
15231531
- G404 # Insecure random number source (rand)
15241532
- G405 # Detect the usage of DES or RC4
1525-
- G406 # Detect the usage of MD4 or RIPEMD160
1533+
- G406 # Detect the usage of deprecated MD4 or RIPEMD160
15261534
- G501 # Import blocklist: crypto/md5
15271535
- G502 # Import blocklist: crypto/des
15281536
- G503 # Import blocklist: crypto/rc4
15291537
- G504 # Import blocklist: net/http/cgi
15301538
- G505 # Import blocklist: crypto/sha1
15311539
- G506 # Import blocklist: golang.org/x/crypto/md4
15321540
- G507 # Import blocklist: golang.org/x/crypto/ripemd160
1533-
- G601 # Implicit memory aliasing of items from a range statement
1534-
- G602 # Slice access out of bounds
1541+
- G601 # Implicit memory aliasing in RangeStmt
1542+
- G602 # Possible slice bounds out of range
15351543

15361544
# To specify a set of rules to explicitly exclude.
15371545
# Available rules: https://github.com/securego/gosec#available-rules
15381546
# Default: []
15391547
excludes:
1540-
- G101 # Look for hard coded credentials
1548+
- G101 # Look for hardcoded credentials
15411549
- G102 # Bind to all interfaces
15421550
- G103 # Audit the use of unsafe block
15431551
- G104 # Audit errors not checked
1544-
- G106 # Audit the use of ssh.InsecureIgnoreHostKey
1552+
- G106 # Audit the use of ssh.InsecureIgnoreHostKey function
15451553
- G107 # Url provided to HTTP request as taint input
1546-
- G108 # Profiling endpoint automatically exposed on /debug/pprof
1547-
- G109 # Potential Integer overflow made by strconv.Atoi result conversion to int16/32
1548-
- G110 # Potential DoS vulnerability via decompression bomb
1549-
- G111 # Potential directory traversal
1550-
- G112 # Potential slowloris attack
1554+
- G108 # Profiling endpoint is automatically exposed
1555+
- G109 # Converting strconv.Atoi result to int32/int16
1556+
- G110 # Detect io.Copy instead of io.CopyN when decompression
1557+
- G111 # Detect http.Dir('/') as a potential risk
1558+
- G112 # Detect ReadHeaderTimeout not configured as a potential risk
15511559
- G114 # Use of net/http serve function that has no support for setting timeouts
1552-
- G115 # Potential integer overflow when converting between integer types
1560+
- G115 # Type conversion which leads to integer overflow
1561+
- G116 # Detect Trojan Source attacks using bidirectional Unicode characters
15531562
- G201 # SQL query construction using format string
15541563
- G202 # SQL query construction using string concatenation
15551564
- G203 # Use of unescaped data in HTML templates
15561565
- G204 # Audit use of command execution
15571566
- G301 # Poor file permissions used when creating a directory
1558-
- G302 # Poor file permissions used with chmod
1567+
- G302 # Poor file permissions used when creation file or using chmod
15591568
- G303 # Creating tempfile using a predictable path
15601569
- G304 # File path provided as taint input
1561-
- G305 # File traversal when extracting zip/tar archive
1562-
- G306 # Poor file permissions used when writing to a new file
1570+
- G305 # File path traversal when extracting zip archive
1571+
- G306 # Poor file permissions used when writing to a file
15631572
- G307 # Poor file permissions used when creating a file with os.Create
15641573
- G401 # Detect the usage of MD5 or SHA1
15651574
- G402 # Look for bad TLS connection settings
15661575
- G403 # Ensure minimum RSA key length of 2048 bits
15671576
- G404 # Insecure random number source (rand)
15681577
- G405 # Detect the usage of DES or RC4
1569-
- G406 # Detect the usage of MD4 or RIPEMD160
1578+
- G406 # Detect the usage of deprecated MD4 or RIPEMD160
15701579
- G501 # Import blocklist: crypto/md5
15711580
- G502 # Import blocklist: crypto/des
15721581
- G503 # Import blocklist: crypto/rc4
15731582
- G504 # Import blocklist: net/http/cgi
15741583
- G505 # Import blocklist: crypto/sha1
15751584
- G506 # Import blocklist: golang.org/x/crypto/md4
15761585
- G507 # Import blocklist: golang.org/x/crypto/ripemd160
1577-
- G601 # Implicit memory aliasing of items from a range statement
1578-
- G602 # Slice access out of bounds
1586+
- G601 # Implicit memory aliasing in RangeStmt
1587+
- G602 # Possible slice bounds out of range
15791588

15801589
# Filter out the issues with a lower severity than the given value.
15811590
# Valid options are: low, medium, high.
@@ -2149,6 +2158,8 @@ linters:
21492158
- slicessort
21502159
# Use iterators instead of Len/At-style APIs.
21512160
- stditerators
2161+
# Replace strings.Index etc. with strings.Cut.
2162+
- stringscut
21522163
# Replace HasPrefix/TrimPrefix with CutPrefix.
21532164
- stringscutprefix
21542165
# Replace ranging over Split/Fields with SplitSeq/FieldsSeq.
@@ -2157,6 +2168,8 @@ linters:
21572168
- stringsbuilder
21582169
# Replace context.WithCancel with t.Context in tests.
21592170
- testingcontext
2171+
# Replace unsafe pointer arithmetic with function calls.
2172+
- unsafefuncs
21602173
# Replace wg.Add(1)/go/wg.Done() with wg.Go.
21612174
- waitgroup
21622175

@@ -3980,7 +3993,22 @@ linters:
39803993
# Enable SQL builder checking.
39813994
# Default: true
39823995
check-sql-builders: false
3983-
# Regex patterns for acceptable SELECT * usage.
3996+
# Enable aliased wildcard detection like `SELECT t.*`.
3997+
# Default: true
3998+
check-aliased-wildcard: false
3999+
# Enable string concatenation analysis.
4000+
# Default: true
4001+
check-string-concat: false
4002+
# Enable format string analysis like `fmt.Sprintf`.
4003+
# Default: true
4004+
check-format-strings: false
4005+
# Enable strings.Builder analysis.
4006+
# Default: true
4007+
check-string-builder: false
4008+
# Enable subquery analysis.
4009+
# Default: true
4010+
check-subqueries: false
4011+
# Regex patterns for acceptable `SELECT *` usage.
39844012
# Default:
39854013
# - "SELECT \\* FROM information_schema\\..*"
39864014
# - "SELECT \\* FROM pg_catalog\\..*"
@@ -3990,6 +4018,22 @@ linters:
39904018
allowed-patterns:
39914019
- "SELECT \\* FROM temp_.*"
39924020
- "SELECT \\* FROM.*-- migration"
4021+
# Functions to ignore (regex patterns)
4022+
# Default: []
4023+
ignored-functions:
4024+
- "debug\\..*"
4025+
- "test.*"
4026+
# SQL builder libraries to check.
4027+
# Default: all true.
4028+
sql-builders:
4029+
squirrel: false
4030+
gorm: false
4031+
sqlx: false
4032+
ent: false
4033+
pgx: false
4034+
bun: false
4035+
sqlboiler: false
4036+
jet: false
39934037

39944038
unused:
39954039
# Mark all struct fields that have been written to as used.

docs/data/linters_info.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@
189189
"name": "errorlint",
190190
"desc": "Find code that can cause problems with the error wrapping scheme introduced in Go 1.13.",
191191
"loadMode": 8767,
192-
"originalURL": "https://github.com/polyfloyd/go-errorlint",
192+
"originalURL": "https://codeberg.org/polyfloyd/go-errorlint",
193193
"internal": false,
194194
"canAutoFix": true,
195195
"isSlow": true,

docs/data/thanks.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,8 +506,8 @@
506506
"linters": [
507507
"errorlint"
508508
],
509-
"profile": "https://github.com/sponsors/polyfloyd",
510-
"avatar": "https://github.com/polyfloyd.png"
509+
"profile": "https://codeberg.org/polyfloyd",
510+
"avatar": "https://codeberg.org/polyfloyd.png"
511511
},
512512
{
513513
"name": "raeperd",

jsonschema/golangci.jsonschema.json

Lines changed: 81 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,8 @@
487487
"require-doc",
488488
"deprecated",
489489
"max-len",
490-
"no-unused-link"
490+
"no-unused-link",
491+
"require-stdlib-doclink"
491492
]
492493
},
493494
"gosec-rules": {
@@ -505,6 +506,7 @@
505506
"G112",
506507
"G114",
507508
"G115",
509+
"G116",
508510
"G201",
509511
"G202",
510512
"G203",
@@ -726,10 +728,12 @@
726728
"slicescontains",
727729
"slicessort",
728730
"stditerators",
731+
"stringscut",
729732
"stringscutprefix",
730733
"stringsseq",
731734
"stringsbuilder",
732735
"testingcontext",
736+
"unsafefuncs",
733737
"waitgroup"
734738
]
735739
},
@@ -1934,7 +1938,7 @@
19341938
"properties": {
19351939
"length": {
19361940
"type": "integer",
1937-
"description": "Maximum line length for godocs, not including the `// `, or `/*` or `*/` tokens.",
1941+
"description": "Maximum line length for godocs, not including the `//`, `/*` or `*/` tokens.",
19381942
"default": 77
19391943
}
19401944
}
@@ -2220,6 +2224,11 @@
22202224
"description": "Defines a pattern to validate `go` minimum version directive.",
22212225
"type": "string",
22222226
"default": ""
2227+
},
2228+
"check-module-path": {
2229+
"description": "Check the validity of the module path.",
2230+
"type": "boolean",
2231+
"default": false
22232232
}
22242233
}
22252234
},
@@ -4074,12 +4083,82 @@
40744083
"type": "boolean",
40754084
"default": true
40764085
},
4086+
"check-aliased-wildcard": {
4087+
"description": "Enable aliased wildcard detection like SELECT t.*.",
4088+
"type": "boolean",
4089+
"default": true
4090+
},
4091+
"check-string-concat": {
4092+
"description": "Enable string concatenation analysis.",
4093+
"type": "boolean",
4094+
"default": true
4095+
},
4096+
"check-format-strings": {
4097+
"description": "Enable format string analysis like fmt.Sprintf.",
4098+
"type": "boolean",
4099+
"default": true
4100+
},
4101+
"check-string-builder": {
4102+
"description": "Enable strings.Builder analysis.",
4103+
"type": "boolean",
4104+
"default": true
4105+
},
4106+
"check-subqueries": {
4107+
"description": "Enable subquery analysis.",
4108+
"type": "boolean",
4109+
"default": true
4110+
},
40774111
"allowed-patterns": {
40784112
"description": "Regex patterns for acceptable SELECT * usage.",
40794113
"type": "array",
40804114
"items": {
40814115
"type": "string"
40824116
}
4117+
},
4118+
"ignored-functions": {
4119+
"description": "Functions to ignore.",
4120+
"type": "array",
4121+
"items": {
4122+
"type": "string"
4123+
}
4124+
},
4125+
"sql-builders": {
4126+
"type": "object",
4127+
"additionalProperties": false,
4128+
"properties": {
4129+
"squirrel": {
4130+
"type": "boolean",
4131+
"default": true
4132+
},
4133+
"gorm": {
4134+
"type": "boolean",
4135+
"default": true
4136+
},
4137+
"sqlx": {
4138+
"type": "boolean",
4139+
"default": true
4140+
},
4141+
"ent": {
4142+
"type": "boolean",
4143+
"default": true
4144+
},
4145+
"pgx": {
4146+
"type": "boolean",
4147+
"default": true
4148+
},
4149+
"bun": {
4150+
"type": "boolean",
4151+
"default": true
4152+
},
4153+
"sqlboiler": {
4154+
"type": "boolean",
4155+
"default": true
4156+
},
4157+
"jet": {
4158+
"type": "boolean",
4159+
"default": true
4160+
}
4161+
}
40834162
}
40844163
}
40854164
},

0 commit comments

Comments
 (0)