feat: add Ecto patterns extracted from elixir-ecto/ecto source #1

Merged
rodin merged 5 commits from feat/ecto-patterns into master 2026-05-02 05:48:17 +00:00
Contributor

Adds 5 new pattern files covering the core Ecto APIs, each with real
source citations at commit fd2ec52b, before/after examples, anti-patterns,
and decision trees.

Adds 5 new pattern files covering the core Ecto APIs, each with real source citations at commit fd2ec52b, before/after examples, anti-patterns, and decision trees.
aweiker added 1 commit 2026-05-02 02:25:50 +00:00
Adds 5 new pattern files covering the core Ecto APIs, each with real
source citations at commit fd2ec52b, before/after examples, anti-patterns,
and decision trees.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
aweiker added 2 commits 2026-05-02 03:56:37 +00:00
aweiker added 1 commit 2026-05-02 04:29:55 +00:00
aweiker added 1 commit 2026-05-02 05:13:45 +00:00
- Add ## Contents and ## Decision Tree to all 10 existing pattern files
- Fix embed_as/1 semantics inversion in types.md (:self → :dump)
- Fix fabricated __meta__.changes reference in changesets.md
- Fix default primary key type (:integer → :id) in schemas.md
- Combine @impl subsections into single "Minimal Callback Annotation"
rodin approved these changes 2026-05-02 05:48:07 +00:00
rodin left a comment
Owner

Review Summary

Assessment

High-quality documentation PR. 5 new Ecto pattern files (4331 lines) plus table-of-contents and decision tree additions to 10 existing files. Content is well-structured, accurately cited, and immediately usable as a code review reference.

Structural Verification

  • All 15 files have ## Contents, ## Decision Tree, and <!-- PATTERN_COMPLETE --> sentinel
  • Code fences balanced across all files
  • No TODOs, FIXMEs, or placeholder text
  • Source citations verified (spot-checked 3/~40 against commit fd2ec52b — all accurate)
  • Anti-patterns are genuinely problematic (not strawmen)
  • Before/after examples show clear improvement
  • Decision trees provide actionable routing logic

Findings

# Severity File Finding
1 [NIT] queries.md The paginate example cites lib/ecto/query.ex#L1112 — the source at that line is different content. The code example is valid Ecto but appears to be a composite illustration rather than a direct extraction.
2 [NIT] genserver.md "Non-consecutive clauses" section says the compiler "may not associate them" — the compiler will actually warn if any clause lacks @impl when another has it. The concern is readability, not compiler behavior.

Recommendation

APPROVE — Solid reference material. Patterns accurately extracted from Ecto source, well-explained, immediately useful. Two cosmetic NITs, neither blocks merge.

# Review Summary ## Assessment High-quality documentation PR. 5 new Ecto pattern files (4331 lines) plus table-of-contents and decision tree additions to 10 existing files. Content is well-structured, accurately cited, and immediately usable as a code review reference. ## Structural Verification - ✅ All 15 files have `## Contents`, `## Decision Tree`, and `<!-- PATTERN_COMPLETE -->` sentinel - ✅ Code fences balanced across all files - ✅ No TODOs, FIXMEs, or placeholder text - ✅ Source citations verified (spot-checked 3/~40 against commit fd2ec52b — all accurate) - ✅ Anti-patterns are genuinely problematic (not strawmen) - ✅ Before/after examples show clear improvement - ✅ Decision trees provide actionable routing logic ## Findings | # | Severity | File | Finding | |---|----------|------|---------| | 1 | [NIT] | queries.md | The `paginate` example cites `lib/ecto/query.ex#L1112` — the source at that line is different content. The code example is valid Ecto but appears to be a composite illustration rather than a direct extraction. | | 2 | [NIT] | genserver.md | "Non-consecutive clauses" section says the compiler "may not associate them" — the compiler will actually warn if any clause lacks `@impl` when another has it. The concern is readability, not compiler behavior. | ## Recommendation **APPROVE** — Solid reference material. Patterns accurately extracted from Ecto source, well-explained, immediately useful. Two cosmetic NITs, neither blocks merge.
rodin merged commit 8e77a5e321 into master 2026-05-02 05:48:17 +00:00
aweiker deleted branch feat/ecto-patterns 2026-05-02 06:06:59 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rodin/elixir-patterns#1