Skip to content

Commit 78ea547

Browse files
fredbiclaude
andcommitted
doc: include previously ignored rule files
Add linting.md and testing.md rules that were hidden by the old .gitignore pattern. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> Signed-off-by: Frederic BIDON <[email protected]>
1 parent b607bad commit 78ea547

2 files changed

Lines changed: 64 additions & 0 deletions

File tree

.claude/rules/linting.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
paths:
3+
- "**/*.go"
4+
---
5+
6+
# Linting conventions (go-openapi)
7+
8+
```sh
9+
golangci-lint run
10+
```
11+
12+
Config: `.golangci.yml` — posture is `default: all` with explicit disables.
13+
See `docs/STYLE.md` for the rationale behind each disabled linter.
14+
15+
Key rules:
16+
- Every `//nolint` directive **must** have an inline comment explaining why.
17+
- Prefer disabling a linter over scattering `//nolint` across the codebase.

.claude/rules/testing.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
paths:
3+
- "**/*_test.go"
4+
---
5+
6+
# Testing conventions (go-openapi)
7+
8+
## Running tests
9+
10+
**Single module repos:**
11+
12+
```sh
13+
go test ./...
14+
```
15+
16+
**Mono-repos (with `go.work`):**
17+
18+
```sh
19+
# All modules
20+
go test work ./...
21+
22+
# Single module
23+
go test ./conv/...
24+
```
25+
26+
Note: in mono-repos, plain `go test ./...` only tests the root module.
27+
The `work` pattern expands to all modules listed in `go.work`.
28+
29+
CI runs tests on `{ubuntu, macos, windows} x {stable, oldstable}` with `-race` via `gotestsum`.
30+
31+
## Fuzz tests
32+
33+
```sh
34+
# List all fuzz targets
35+
go test -list Fuzz ./...
36+
37+
# Run a specific target (go test -fuzz cannot span multiple packages)
38+
go test -fuzz=Fuzz -run='FuzzTargetName$' -fuzztime=1m30s ./package
39+
```
40+
41+
Fuzz corpus lives in `testdata/fuzz/` within each package. CI runs each fuzz target for 1m30s
42+
with a 5m minimize timeout.
43+
44+
## Test framework
45+
46+
`github.com/go-openapi/testify/v2` — a zero-dep fork of `stretchr/testify`.
47+
Because it's a fork, `testifylint` does not work.

0 commit comments

Comments
 (0)