Skip to content

Commit 90e5ea1

Browse files
Copilotpelikhan
andcommitted
Document testifylint availability and keep it disabled for now
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
1 parent dd54206 commit 90e5ea1

2 files changed

Lines changed: 14 additions & 9 deletions

File tree

.golangci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ linters:
99
enable:
1010
- misspell
1111
- unconvert
12-
- testifylint
12+
# testifylint disabled due to requiring extensive test refactoring
13+
# Re-enable after addressing existing issues: golangci-lint run --enable=testifylint
1314
# gosec disabled in golangci-lint due to configuration complexity
1415
# Can be enabled separately with: gosec -exclude=G101,G104,G115,G301,G302,G304,G306 ./...
1516
disable:
1617
- errcheck
1718
- gocritic
1819
- revive
20+
- testifylint
1921
- gosec
2022

2123
linters-settings:

AGENTS.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -172,19 +172,22 @@ assert.JSONEq(t, expectedJSON, actualJSON)
172172

173173
**golangci-lint** is integrated and runs as part of `make lint`:
174174
- Configuration: `.golangci.yml` (version 2 format)
175-
- Enabled linters: `misspell`, `unconvert`, `testifylint`
176-
- Disabled linters: `gosec`, `errcheck`, `gocritic`, `revive`
175+
- Enabled linters: `misspell`, `unconvert`
176+
- Disabled linters: `gosec`, `testifylint`, `errcheck`, `gocritic`, `revive`
177177
- Install: `make install` (installs golangci-lint v2.8.0)
178178
- Run manually: `golangci-lint run --timeout=5m`
179179

180-
**testifylint**: Automatically catches common testify mistakes:
181-
- Suggests `assert.Empty(t, x)` instead of `assert.True(t, len(x) == 0)`
182-
- Suggests `assert.True(t, x)` instead of `assert.Equal(t, true, x)`
183-
- Suggests `assert.NoError(t, err)` instead of `assert.Nil(t, err)`
180+
**testifylint**: Available but disabled due to requiring extensive test refactoring across the codebase.
181+
- Automatically catches common testify mistakes:
182+
- Suggests `assert.Empty(t, x)` instead of `assert.True(t, len(x) == 0)`
183+
- Suggests `assert.True(t, x)` instead of `assert.Equal(t, true, x)`
184+
- Suggests `assert.NoError(t, err)` instead of `assert.Nil(t, err)`
185+
- To run on specific files: `golangci-lint run --enable=testifylint --timeout=5m <files>`
186+
- To run on entire codebase: `golangci-lint run --enable=testifylint --timeout=5m`
184187

185-
**Note**: Some linters (gosec, errcheck) are disabled to minimize noise. Enable them for stricter checks:
188+
**Note**: Some linters (gosec, testifylint, errcheck) are disabled to minimize noise. Enable them for stricter checks:
186189
```bash
187-
golangci-lint run --enable=gosec,errcheck --timeout=5m
190+
golangci-lint run --enable=gosec,testifylint,errcheck --timeout=5m
188191
```
189192

190193
## Test Structure

0 commit comments

Comments
 (0)