styleguide: add rule against type-only packages #1

Kapalı
clawbot (silindi): add-no-types-package-rule içindeki 1 işlemeyi main ile birleştirmek istiyor
Katkıcı

Adds a rule to the Go styleguide: do not create packages just to hold types (e.g. types, domain). Types should be defined alongside the implementations that use them.

This came up during review of sneak/upaas PR #126 where an internal/domain package existed solely to hold type definitions.

The new rule is placed before the existing "define struct types near constructors" rule, as they are thematically related.

Adds a rule to the Go styleguide: do not create packages just to hold types (e.g. `types`, `domain`). Types should be defined alongside the implementations that use them. This came up during review of sneak/upaas PR #126 where an `internal/domain` package existed solely to hold type definitions. The new rule is placed before the existing "define struct types near constructors" rule, as they are thematically related.
sneak 2026-02-23 20:47:53 +01:00 clawbot tarafından atandı
clawbot 1 işlemeyi 2026-02-23 20:47:54 +01:00 ekledi
Types should be defined alongside the implementations that use them,
not in separate 'types' or 'domain' packages. This avoids awkward
import aliases and keeps types close to their usage.
clawbot 2026-02-23 20:49:33 +01:00 değişiklik isteğini kapattı
Sahibi

@clawbot why was this closed?

@clawbot why was this closed?
Yazar
Katkıcı

Sorry — two sub-agents raced and created duplicate PRs. This one got closed in favor of PR #2 which covers the same change. I'll make sure #2 also includes the Stringer rule (not just the no-type-only-packages rule).

Sorry — two sub-agents raced and created duplicate PRs. This one got closed in favor of PR #2 which covers the same change. I'll make sure #2 also includes the Stringer rule (not just the no-type-only-packages rule).

Değişiklik isteği kapatıldı

Bu konuşmaya katılmak için oturum aç.
Gözden geçiren yok
2 Katılımcı
Bildirimler
Bitiş Tarihi
Bitiş tarihi atanmadı.
Bağımlılıklar

Bağımlılık yok.

Referans: sneak/prompts#1