feat(convention): add built-in slidev convention (plan 2606270013)#706
Open
jeduden wants to merge 5 commits into
Open
feat(convention): add built-in slidev convention (plan 2606270013)#706jeduden wants to merge 5 commits into
jeduden wants to merge 5 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Disables the eight default-on rules that produce false positives on Slidev presentation Markdown: heading-style, heading-increment, first-line-heading, no-duplicate-headings, blank-line-around-headings, no-trailing-punctuation-in-heading, no-emphasis-as-heading, empty-section-body. Uses FlavorAny so the convention does not force a flavor change. Closes issue #41 (rule-configuration layer only; the parser-level `---`-as-page-separator issue is out of scope). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012teDVC4T7vuxdaTBSBQ4nJ
…0013 Document the slidev built-in convention in docs/reference/conventions.md with purpose, eight-rule table, and parser-level limitation note. Update the Built-in values list and Reserved names section to include slidev. Mark all plan tasks and acceptance criteria done; set status to ✅. The conventions.md line budget required condensing three existing sections (plain future-rules paragraph, How-presets-layer detail, Disabling-MDS034 code block, Resolution-order + Interaction subsections) to make room while staying within the 300-line content limit. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012teDVC4T7vuxdaTBSBQ4nJ
- Replace require.True with assert.True inside TestLookup_Slidev loop so all missing rules are reported rather than stopping at the first (matches TestGomarklintParityRuleSet's established pattern) - Add "slidev" to the built-in conventions list in the background concepts doc (flavor-rule-convention-kind.md was not updated) - Add "slidev" to the hand-written error-message example in docs/reference/conventions.md so it matches what the runtime emits Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012teDVC4T7vuxdaTBSBQ4nJ
Round-2 code-review findings:
- convention_test.go: wrap assert.False(p.Enabled) in if assert.True(ok)
guard so a missing rule entry causes an explicit failure instead of
passing vacuously via the zero-value RulePreset{Enabled:false}.
- docs/reference/conventions.md: correct the heading-style row — the
actual cause is the --- slide separator being parsed as a setext
heading underline, not "layout blocks." Update the slidev prose and
the flavor-agreement paragraph to note that FlavorAny conventions
(slidev, no-llm-tells) do not enforce the flavor-conflict check.
- docs/background/concepts/flavor-rule-convention-kind.md: "pairs a
flavor" implied all conventions pin a concrete flavor; rephrase to
"optionally pins a flavor" to cover FlavorAny conventions.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012teDVC4T7vuxdaTBSBQ4nJ
Round-3 code-review findings: - convention_test.go: use require.Len (fatal) instead of assert.Len so a rule-count drift immediately aborts the test rather than silently allowing the for-loop to skip the new entry unasserted. - config/convention_test.go: add two integration-level tests for slidev through the applyConvention path — one verifying the FlavorAny bypass accepts a user markdown-flavor setting, one verifying all eight disabled rules land in ConventionPreset. no-llm-tells had analogous tests; slidev now matches the pattern. - docs/reference/conventions.md: restore the "shadowing is impossible" conclusion in the resolution-order section so readers scanning that section understand that a collision is a hard error, not a silent override. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012teDVC4T7vuxdaTBSBQ4nJ
058c60a to
2e21a7b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
slidevbuilt-in convention that disables the eight default-on rules producing false positives on Slidev presentation Markdown files (heading-style,heading-increment,first-line-heading,no-duplicate-headings,blank-line-around-headings,no-trailing-punctuation-in-heading,no-emphasis-as-heading,empty-section-body). Closes Slidev presentation files not well supported #41.FlavorAnyso the convention is renderer-agnostic — authors may use GFM, CommonMark, or any other flavor.docs/reference/conventions.mdand updates the concepts doc to reflect that conventions optionally pin a flavor (coveringFlavorAnyconventions likeslidevandno-llm-tells).internal/config/convention_test.goverifying the FlavorAny bypass and that all eight disabled rules land inConventionPreset.Changes
internal/convention/convention.go— new"slidev"entry in the built-in conventions map.internal/convention/convention_test.go—TestLookup_Slidevcovering all eight rules; updatedTestNamesSorted;require.Len(fatal) instead ofassert.Lenso a rule-count drift immediately aborts instead of silently skipping the new entry.internal/config/convention_test.go—TestApplyConvention_Slidev_FlavorAnyAllowsUserFlavorandTestApplyConvention_Slidev_DisablesEightRulesInPreset, matching the pattern already established forno-llm-tells.docs/reference/conventions.md— new### slidevsection; flavor-agreement paragraph clarified forFlavorAnyconventions; resolution-order section restores the "shadowing is impossible" conclusion.docs/background/concepts/flavor-rule-convention-kind.md— Convention definition updated: "optionally pins a flavor" instead of "pairs a flavor."plan/2606270013_slidev-convention.md— new plan file, status ✅.Test plan
go test ./internal/convention/...— greengo test ./internal/config/...— green (two new slidev integration tests)go test ./...— all greengo run ./cmd/mdsmith check .— 0 failuresGenerated by Claude Code