Vibe-guided bskyoauth and custom repo example code in Golang 馃 probably not safe to use in prod
1# golangci-lint configuration for bskyoauth
2# See: https://golangci-lint.run/usage/configuration/
3
4run:
5 timeout: 5m
6 tests: true
7 modules-download-mode: readonly
8
9linters:
10 enable:
11 - errcheck # Check for unchecked errors
12 - gosimple # Simplify code
13 - govet # Vet examines Go source code
14 - ineffassign # Detect ineffectual assignments
15 - staticcheck # Advanced Go linter
16 - unused # Check for unused code
17 - gofmt # Check code formatting
18 - goimports # Check import formatting
19 - misspell # Check for misspelled words
20 - revive # Fast, configurable, extensible linter
21 - gosec # Security-focused linter
22 - unconvert # Remove unnecessary type conversions
23 - unparam # Find unused function parameters
24 - prealloc # Find slice declarations that could be preallocated
25 - nilerr # Find code that returns nil even if it checks that the error is not nil
26
27linters-settings:
28 errcheck:
29 # Report about not checking of errors in type assertions: `a := b.(MyStruct)`
30 check-type-assertions: false
31 # Exclude these functions from error checking
32 exclude-functions:
33 - (github.com/shindakun/bskyoauth/vendor/github.com/whyrusleeping/cbor-gen.WriteMajorTypeHeader)
34 - (*encoding/json.Encoder).Encode
35 - (io.ReadCloser).Close
36 - (crypto/rand.Read)
37
38 govet:
39 # Enable all analyzers
40 enable-all: true
41 # Disable some checks that can be too noisy
42 disable:
43 - shadow
44 - fieldalignment # Performance optimization, not critical
45
46 revive:
47 # Enable all rules
48 rules:
49 - name: exported
50 disabled: false
51 arguments:
52 - "checkPrivateReceivers"
53 - "sayRepetitiveInsteadOfStutters"
54
55 gosec:
56 # Only check high and medium severity issues
57 severity: medium
58 confidence: medium
59 excludes:
60 - G104 # Allow unhandled errors in defer statements
61 - G115 # Allow integer conversions (overflow check not critical for our use case)
62 - G304 # Allow file path from variable (necessary for our use case)
63 - G404 # Allow weak random number generator for non-security purposes
64
65 misspell:
66 locale: US
67
68 goimports:
69 local-prefixes: github.com/shindakun/bskyoauth
70
71issues:
72 # Maximum issues count per one linter
73 max-issues-per-linter: 0
74 # Maximum count of issues with the same text
75 max-same-issues: 0
76
77 # Exclude some linters from running on tests files
78 exclude-rules:
79 # Exclude some linters from running on tests files
80 - path: _test\.go
81 linters:
82 - gosec
83 - errcheck
84 - unparam
85 - staticcheck
86
87 # Exclude unparam for test helper functions
88 - path: jwt\.go
89 linters:
90 - unparam
91
92 # Exclude known false positives
93 - text: "weak cryptographic primitive"
94 linters:
95 - gosec
96
97 # Exclude SA5011 (nil pointer dereference after explicit nil check)
98 - text: "SA5011"
99 linters:
100 - staticcheck
101
102 # Exclude rand.Read error checking (crypto/rand.Read returns error only in very rare cases)
103 - text: "Error return value of `rand.Read` is not checked"
104 linters:
105 - errcheck
106
107 # Exclude deprecated warnings for dependencies we don't control
108 - path: vendor/
109 linters:
110 - staticcheck
111
112output:
113 formats:
114 - format: colored-line-number
115 print-issued-lines: true
116 print-linter-name: true
117 sort-results: true