Version Cursor rules

Track .cursor/rules/ in git so coding conventions are shared
across the team. Everything else under .cursor/ stays ignored.

Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
Émile Ré
2026-05-19 14:10:39 +04:00
parent 58d3ba3823
commit 8f8f09008a
16 changed files with 687 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
---
description: Go declarations — group related types/consts/vars, no iota for string enums
globs: "**/*.go"
alwaysApply: false
---
# Go grouped declarations
Group related declarations using `type ()`, `const ()`, and `var ()` blocks.
```go
// GOOD — grouped type block
type (
CreateFooRequest struct {
Name string
Active bool
}
UpdateFooRequest struct {
ID gid.GID
Name *string
Active *bool
}
)
// GOOD — grouped const block
const (
NameMaxLength = 100
ContentMaxLength = 5000
)
// GOOD — interface satisfaction checks
var (
_ Reader = (*FileReader)(nil)
_ Writer = (*FileWriter)(nil)
)
```
## String enums
Use explicit typed string values, **not** `iota`:
```go
// GOOD
type Status string
const (
StatusActive Status = "active"
StatusInactive Status = "inactive"
)
// BAD — iota for string-like enums
type Status int
const (
StatusActive Status = iota
StatusInactive
)
```