style: strengthen constructor naming and Params struct rules #19

Merged
sneak merged 4 commits from style/constructor-naming-params into main 2026-03-20 07:06:03 +01:00
Collaborator

Per sneak's instruction:

  • Constructors must be New(), From<Something>(), or NewThing() (multi-type packages only)
  • Strongly discourage creative names (Create, Make, Build, Init)
  • Constructors must use a Params struct (or ThingParams) for 2+ arguments — no exceptions
  • Single obvious argument (ctx, bytes) is the only exception
  • context.Context does not count against the argument limit (already documented)
Per sneak's instruction: - Constructors **must** be `New()`, `From<Something>()`, or `NewThing()` (multi-type packages only) - Strongly discourage creative names (`Create`, `Make`, `Build`, `Init`) - Constructors **must** use a `Params` struct (or `ThingParams`) for 2+ arguments — no exceptions - Single obvious argument (`ctx`, bytes) is the only exception - `context.Context` does not count against the argument limit (already documented)
sneak was assigned by clawbot 2026-03-18 03:53:59 +01:00
Owner

@clawbot needs fmt

@clawbot needs fmt
sneak was unassigned by clawbot 2026-03-18 05:40:08 +01:00
clawbot self-assigned this 2026-03-18 05:40:09 +01:00
clawbot added the needs-rework label 2026-03-18 05:40:09 +01:00
clawbot force-pushed style/constructor-naming-params from 59999115b1 to d83bd08d4d 2026-03-18 05:41:50 +01:00 Compare
Author
Collaborator

Rework complete — formatting fix

Ran make fmt (prettier) which rewrapped lines in the constructor naming section of prompts/CODE_STYLEGUIDE_GO.md. The content is unchanged; only line breaks were adjusted to comply with prettier's prose-wrap rules.

  • make check passes
  • docker build . passes
  • Rebased onto main
**Rework complete — formatting fix** Ran `make fmt` (prettier) which rewrapped lines in the constructor naming section of `prompts/CODE_STYLEGUIDE_GO.md`. The content is unchanged; only line breaks were adjusted to comply with prettier's prose-wrap rules. - `make check` passes - `docker build .` passes - Rebased onto `main`
clawbot added needs-review and removed needs-rework labels 2026-03-18 05:43:10 +01:00
Author
Collaborator

Code Review: PR #19 — style: strengthen constructor naming and Params struct rules

Policy Divergences

VIOLATION: last_modified not updated in YAML front matter

prompts/CODE_STYLEGUIDE_GO.md line 3 still reads last_modified: 2026-02-22 despite substantive content changes (18 insertions, 5 deletions). REPO_POLICIES.md states:

Cross-project documentation (such as this file) must include last_modified: YYYY-MM-DD in the YAML front matter so it can be kept in sync with the authoritative source as policies evolve.

CODE_STYLEGUIDE_GO.md is cross-project documentation. Its content was modified. The last_modified date must be updated to reflect the change date.

Requirements Checklist

# Requirement Status
1 Constructors must be New(), From<Something>(), or NewThing() (multi-type packages only) ✅ Met
2 Strongly discourage creative names (Create, Make, Build, Init) ✅ Met
3 Constructors must use a Params struct (or ThingParams) for 2+ arguments — no exceptions ✅ Met (PR goes slightly further: "even for a single argument" with exception for obvious cases, consistent with issue bullet 4)
4 Single obvious argument (ctx, bytes) is the only exception ✅ Met
5 context.Context does not count against the argument limit (already documented) ✅ Met (pre-existing, unchanged)
6 sneak's "needs fmt" comment addressed ✅ Met (commit d83bd08)

Build Result

docker build . — PASS (all cached, make check succeeds)

Cheating Check

No changes to Makefile, Dockerfile, .prettierrc, .prettierignore, .editorconfig, .golangci.yml, CI workflow, package.json, or yarn.lock. Clean.

Verdict: ❌ FAIL

The content changes are correct and complete, but the last_modified front matter in prompts/CODE_STYLEGUIDE_GO.md must be updated to today's date per REPO_POLICIES.md. This is a one-line fix.

## Code Review: [PR #19](https://git.eeqj.de/sneak/prompts/pulls/19) — style: strengthen constructor naming and Params struct rules ### Policy Divergences **VIOLATION: `last_modified` not updated in YAML front matter** `prompts/CODE_STYLEGUIDE_GO.md` line 3 still reads `last_modified: 2026-02-22` despite substantive content changes (18 insertions, 5 deletions). REPO_POLICIES.md states: > Cross-project documentation (such as this file) must include `last_modified: YYYY-MM-DD` in the YAML front matter so it can be kept in sync with the authoritative source as policies evolve. `CODE_STYLEGUIDE_GO.md` is cross-project documentation. Its content was modified. The `last_modified` date must be updated to reflect the change date. ### Requirements Checklist | # | Requirement | Status | |---|---|---| | 1 | Constructors **must** be `New()`, `From<Something>()`, or `NewThing()` (multi-type packages only) | ✅ Met | | 2 | Strongly discourage creative names (`Create`, `Make`, `Build`, `Init`) | ✅ Met | | 3 | Constructors **must** use a `Params` struct (or `ThingParams`) for 2+ arguments — no exceptions | ✅ Met (PR goes slightly further: "even for a single argument" with exception for obvious cases, consistent with issue bullet 4) | | 4 | Single obvious argument (`ctx`, bytes) is the only exception | ✅ Met | | 5 | `context.Context` does not count against the argument limit (already documented) | ✅ Met (pre-existing, unchanged) | | 6 | sneak's "needs fmt" comment addressed | ✅ Met (commit `d83bd08`) | ### Build Result `docker build .` — **PASS** (all cached, `make check` succeeds) ### Cheating Check No changes to Makefile, Dockerfile, `.prettierrc`, `.prettierignore`, `.editorconfig`, `.golangci.yml`, CI workflow, `package.json`, or `yarn.lock`. Clean. ### Verdict: ❌ FAIL The content changes are correct and complete, but the `last_modified` front matter in `prompts/CODE_STYLEGUIDE_GO.md` must be updated to today's date per REPO_POLICIES.md. This is a one-line fix.
clawbot added needs-rework and removed needs-review labels 2026-03-18 05:47:19 +01:00
clawbot added 1 commit 2026-03-18 05:49:33 +01:00
Author
Collaborator

Rework complete — last_modified date fix

Updated last_modified in prompts/CODE_STYLEGUIDE_GO.md YAML front matter from 2026-02-22 to 2026-03-18 per REPO_POLICIES.md requirements.

  • make fmt — no changes needed (already clean)
  • make check — passes
  • docker build . — passes
  • Rebased onto main
  • README verified accurate

Single commit: a8a469e — one-line fix, no other changes.

## Rework complete — `last_modified` date fix Updated `last_modified` in `prompts/CODE_STYLEGUIDE_GO.md` YAML front matter from `2026-02-22` to `2026-03-18` per REPO_POLICIES.md requirements. - `make fmt` — no changes needed (already clean) - `make check` — passes - `docker build .` — passes - Rebased onto `main` - README verified accurate Single commit: `a8a469e` — one-line fix, no other changes.
clawbot added needs-review and removed needs-rework labels 2026-03-18 05:50:00 +01:00
Author
Collaborator

Code Review: PR #19 — style: strengthen constructor naming and Params struct rules

Policy Divergences

No policy violations found.

  • last_modified YAML front matter: ✅ Updated to 2026-03-18 (was the sole finding from the previous review cycle — now fixed)
  • External references pinned by hash: N/A (no new external references)
  • Formatting (prettier proseWrap: always): ✅ Passes make fmt-check
  • No changes to Makefile, Dockerfile, .prettierrc, .prettierignore, .editorconfig, CI workflow, package.json, or yarn.lock: ✅ Clean
  • Feature branch workflow: ✅ style/constructor-naming-params
  • Only one file changed (prompts/CODE_STYLEGUIDE_GO.md): ✅ No scope creep

Requirements Checklist

# Requirement Status
1 Constructors must be New() ✅ Met — changed from "should" to "must"
2 From<Something>() acceptable for conversion constructors ✅ Met — FromBytes(), FromConfig() examples included
3 NewThing() for multi-type packages only ✅ Met — described as "occasionally acceptable" with preference for package restructuring
4 Strongly discourage Create, Make, Build, Init ✅ Met — explicit "Do not invent creative constructor names" with named examples, plus "rename it" directive
5 Constructors must use Params struct for 2+ arguments ✅ Met — PR goes further ("even for a single argument"), consistent with requirement 6
6 Single obvious argument (ctx, bytes) is the only exception ✅ Met — "stupidly obvious from context" with examples (featureflag.New(true), thing.NewFromReader(r))
7 context.Context does not count against argument limit ✅ Met — pre-existing, unchanged, still accurate
8 sneak's "needs fmt" comment addressed ✅ Met — commit d83bd08
9 last_modified date updated (previous review finding) ✅ Met — commit a8a469e

Build Result

docker build . — PASS

#11 [7/7] RUN make check
All matched files use Prettier code style!

Rebased onto main — already up to date, build still passes.

Cheating Check

No tooling, linting, or CI configuration modified. Only prompts/CODE_STYLEGUIDE_GO.md changed. Clean.

README Consistency

README.md references CODE_STYLEGUIDE_GO.md generically in the Quick Start commands. No specific constructor naming details in the README that would need updating. ✅ Consistent.

Verdict: ✅ PASS

All issue #19 requirements are fully implemented. The previous review's sole finding (last_modified date) has been fixed. Build passes. No policy violations. No scope creep. No cheating.

## Code Review: [PR #19](https://git.eeqj.de/sneak/prompts/pulls/19) — style: strengthen constructor naming and Params struct rules ### Policy Divergences No policy violations found. - `last_modified` YAML front matter: ✅ Updated to `2026-03-18` (was the sole finding from the previous review cycle — now fixed) - External references pinned by hash: N/A (no new external references) - Formatting (prettier `proseWrap: always`): ✅ Passes `make fmt-check` - No changes to Makefile, Dockerfile, `.prettierrc`, `.prettierignore`, `.editorconfig`, CI workflow, `package.json`, or `yarn.lock`: ✅ Clean - Feature branch workflow: ✅ `style/constructor-naming-params` - Only one file changed (`prompts/CODE_STYLEGUIDE_GO.md`): ✅ No scope creep ### Requirements Checklist | # | Requirement | Status | |---|---|---| | 1 | Constructors **must** be `New()` | ✅ Met — changed from "should" to "**must**" | | 2 | `From<Something>()` acceptable for conversion constructors | ✅ Met — `FromBytes()`, `FromConfig()` examples included | | 3 | `NewThing()` for multi-type packages only | ✅ Met — described as "occasionally acceptable" with preference for package restructuring | | 4 | Strongly discourage `Create`, `Make`, `Build`, `Init` | ✅ Met — explicit "Do not invent creative constructor names" with named examples, plus "rename it" directive | | 5 | Constructors **must** use `Params` struct for 2+ arguments | ✅ Met — PR goes further ("even for a single argument"), consistent with requirement 6 | | 6 | Single obvious argument (`ctx`, bytes) is the only exception | ✅ Met — "stupidly obvious from context" with examples (`featureflag.New(true)`, `thing.NewFromReader(r)`) | | 7 | `context.Context` does not count against argument limit | ✅ Met — pre-existing, unchanged, still accurate | | 8 | sneak's "needs fmt" comment addressed | ✅ Met — commit `d83bd08` | | 9 | `last_modified` date updated (previous review finding) | ✅ Met — commit `a8a469e` | ### Build Result `docker build .` — **PASS** ``` #11 [7/7] RUN make check All matched files use Prettier code style! ``` Rebased onto `main` — already up to date, build still passes. ### Cheating Check No tooling, linting, or CI configuration modified. Only `prompts/CODE_STYLEGUIDE_GO.md` changed. Clean. ### README Consistency README.md references `CODE_STYLEGUIDE_GO.md` generically in the Quick Start commands. No specific constructor naming details in the README that would need updating. ✅ Consistent. ### Verdict: ✅ PASS All [issue #19](https://git.eeqj.de/sneak/prompts/issues/19) requirements are fully implemented. The previous review's sole finding (`last_modified` date) has been fixed. Build passes. No policy violations. No scope creep. No cheating.
clawbot added merge-ready and removed needs-review labels 2026-03-18 05:58:05 +01:00
clawbot removed their assignment 2026-03-18 05:58:05 +01:00
sneak was assigned by clawbot 2026-03-18 05:58:05 +01:00
sneak merged commit 4b64c213f8 into main 2026-03-20 07:06:03 +01:00
sneak deleted branch style/constructor-naming-params 2026-03-20 07:06:03 +01:00
Sign in to join this conversation.