Skip to content

Implement MDS045 list-marker-style rule - #206

Merged
jeduden merged 3 commits into
mainfrom
claude/update-list-marker-style
May 2, 2026
Merged

Implement MDS045 list-marker-style rule#206
jeduden merged 3 commits into
mainfrom
claude/update-list-marker-style

Conversation

@Claude

@Claude Claude AI commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Adds rule MDS045 to enforce consistent bullet characters (-, *, +) for unordered lists, eliminating the three-way ambiguity in CommonMark that causes diff noise.

Implementation

  • Rule logic: Walks *ast.List nodes with !IsOrdered(), computes nesting depth via ancestor count, validates marker against configured style
  • Fix behavior: Replaces marker byte at each list item start (indentation preserved since all markers are single-byte)
  • Configuration:
    • style: dash | asterisk | plus (default: dash)
    • nested: Optional array for depth-based rotation (e.g., [dash, asterisk] alternates by level)
  • Category: list, disabled by default (opt-in)

Example

rules:
  list-marker-style:
    style: dash
    nested: [dash, asterisk]  # outer uses -, inner uses *

Flags and fixes:

* First item      →  - First item
* Second item     →  - Second item
  * Nested        →    * Nested (correct at depth 1)

Testing

  • 23 unit tests covering all styles, nested rotation, and edge cases
  • Fixture tests in MDS045-list-marker-style/ (good/bad/fixed)
  • Completed plan 109 acceptance criteria

Add new rule MDS045 that enforces consistent bullet markers
for unordered lists. The rule pins one of `-`, `*`, or `+`
as the marker and can optionally rotate markers by nesting depth.

- Implement Check() to walk unordered lists and compute depth
- Implement Fix() to replace marker bytes
- Add Configurable interface support for style and nested settings
- Register as MDS045 in category "list" (disabled by default)
- Add comprehensive unit tests in rule_test.go
- Add fixture tests (good/, bad/, fixed/) in MDS045-list-marker-style/
- Add rule documentation in README.md
- Add import in integration test
- Mark plan 109 as completed (✅)

All tests pass.

Agent-Logs-Url: https://github.com/jeduden/mdsmith/sessions/ac3f9ff9-2b18-4354-a2b5-2e1aef7dd4aa

Co-authored-by: jeduden <1117699+jeduden@users.noreply.github.com>
@Claude Claude AI assigned Claude and jeduden Apr 29, 2026
@jeduden
jeduden marked this pull request as ready for review April 29, 2026 05:37
Copilot AI review requested due to automatic review settings April 29, 2026 05:37
@codecov

codecov Bot commented Apr 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.97814% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.94%. Comparing base (6af677f) to head (d2a5a29).

Files with missing lines Patch % Lines
internal/rules/listmarkerstyle/rule.go 87.97% 17 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #206      +/-   ##
==========================================
- Coverage   94.02%   93.94%   -0.08%     
==========================================
  Files         126      127       +1     
  Lines       13715    13898     +183     
==========================================
+ Hits        12895    13056     +161     
- Misses        497      514      +17     
- Partials      323      328       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new opt-in Markdown lint rule (MDS045) to enforce a consistent unordered-list bullet marker (-, *, or +), with optional depth-based rotation, plus accompanying tests and fixtures.

Changes:

  • Implements internal/rules/listmarkerstyle with Check, Fix, and configurable settings (style, nested).
  • Adds unit tests and integration fixtures for MDS045, and wires the rule into the integration test registry.
  • Marks plan 109 complete.

Reviewed changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
plan/109_list-marker-style.md Marks plan status/tasks/acceptance criteria as complete for MDS045.
internal/rules/listmarkerstyle/rule.go New MDS045 rule implementation (AST walk, diagnostics, fixer, settings).
internal/rules/listmarkerstyle/rule_test.go Unit tests for rule metadata, checking, fixing, and settings validation.
internal/rules/listmarkerstyle/README.md Adds rule documentation under the implementation package directory.
internal/rules/listmarkerstyle/good/dash.md Adds a “good” fixture (dash style) under implementation directory.
internal/rules/listmarkerstyle/good/asterisk.md Adds a “good” fixture (asterisk style) under implementation directory.
internal/rules/listmarkerstyle/good/plus.md Adds a “good” fixture (plus style) under implementation directory.
internal/rules/listmarkerstyle/good/nested.md Adds a “good” fixture (nested rotation) under implementation directory.
internal/rules/listmarkerstyle/bad/asterisk-with-dash.md Adds a “bad” fixture (asterisk used when dash configured) under implementation directory.
internal/rules/listmarkerstyle/bad/dash-with-asterisk.md Adds a “bad” fixture (dash used when asterisk configured) under implementation directory.
internal/rules/listmarkerstyle/bad/plus-with-dash.md Adds a “bad” fixture (plus used when dash configured) under implementation directory.
internal/rules/listmarkerstyle/bad/nested-wrong.md Adds a “bad” fixture (wrong nested marker) under implementation directory.
internal/rules/listmarkerstyle/fixed/asterisk-with-dash.md Adds a “fixed” fixture output under implementation directory.
internal/rules/listmarkerstyle/fixed/dash-with-asterisk.md Adds a “fixed” fixture output under implementation directory.
internal/rules/listmarkerstyle/fixed/plus-with-dash.md Adds a “fixed” fixture output under implementation directory.
internal/rules/listmarkerstyle/fixed/nested-wrong.md Adds a “fixed” fixture output under implementation directory.
internal/rules/MDS045-list-marker-style/README.md Adds rule documentation in the canonical rule README location.
internal/rules/MDS045-list-marker-style/good/dash.md Adds canonical “good” fixture (dash).
internal/rules/MDS045-list-marker-style/good/asterisk.md Adds canonical “good” fixture (asterisk).
internal/rules/MDS045-list-marker-style/good/plus.md Adds canonical “good” fixture (plus).
internal/rules/MDS045-list-marker-style/good/nested.md Adds canonical “good” fixture (nested rotation).
internal/rules/MDS045-list-marker-style/bad/asterisk-with-dash.md Adds canonical “bad” fixture (asterisk vs dash).
internal/rules/MDS045-list-marker-style/bad/dash-with-asterisk.md Adds canonical “bad” fixture (dash vs asterisk).
internal/rules/MDS045-list-marker-style/bad/plus-with-dash.md Adds canonical “bad” fixture (plus vs dash).
internal/rules/MDS045-list-marker-style/bad/nested-wrong.md Adds canonical “bad” fixture (wrong nested marker).
internal/rules/MDS045-list-marker-style/fixed/asterisk-with-dash.md Adds canonical “fixed” output for asterisk→dash.
internal/rules/MDS045-list-marker-style/fixed/dash-with-asterisk.md Adds canonical “fixed” output for dash→asterisk.
internal/rules/MDS045-list-marker-style/fixed/plus-with-dash.md Adds canonical “fixed” output for plus→dash.
internal/rules/MDS045-list-marker-style/fixed/nested-wrong.md Adds canonical “fixed” output for nested correction.
internal/integration/rules_test.go Registers the new rule package via blank import so fixtures run in integration tests.

Comment thread internal/rules/listmarkerstyle/README.md Outdated
Comment thread internal/rules/listmarkerstyle/good/dash.md Outdated
Comment thread internal/rules/listmarkerstyle/rule.go Outdated
Comment thread internal/rules/listmarkerstyle/rule.go Outdated
Comment thread internal/rules/listmarkerstyle/rule_test.go
Comment thread internal/rules/MDS045-list-marker-style/README.md Outdated
@jeduden

jeduden commented Apr 29, 2026

Copy link
Copy Markdown
Owner

@copilot apply changes based on the comments in this thread

…, per-item diagnostics, ToStringSlice, mixed-marker tests

Agent-Logs-Url: https://github.com/jeduden/mdsmith/sessions/db9dbd84-c280-487a-9135-9bc191bf9eaf

Co-authored-by: jeduden <1117699+jeduden@users.noreply.github.com>

Copilot AI commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

@copilot apply changes based on the comments in this thread

Applied all review changes in commit 4153ee8:

  • Duplicate fixtures deleted: Removed internal/rules/listmarkerstyle/README.md, good/, bad/, fixed/ — canonical fixtures stay only under MDS045-list-marker-style/.
  • README front matter added: MDS045-list-marker-style/README.md now has id, name, status, description YAML header and follows the proto template (settings table, Config section, <?include?> examples, Meta-Information).
  • ApplySettings uses settings.ToStringSlice: Accepts both []any (YAML) and []string (programmatic) for the nested setting.
  • Per-item marker checking: checkList and collectListEdits now read the actual marker byte from each item's source line via a new markerOnLine helper, emitting one diagnostic per mismatching item rather than one per list node.
  • New tests: TestApplySettings_ValidNested_StringSlice, TestCheck_MixedMarkers_InSequentialLists, TestCheck_MixedMarkers_FixedPerItem cover the requested cases. Bad fixture expected-diagnostics updated to match the per-item approach.

…c280-487a-9135-9bc191bf9eaf

Co-authored-by: jeduden <1117699+jeduden@users.noreply.github.com>
Copilot AI requested a review from jeduden April 29, 2026 06:44
@jeduden
jeduden requested a review from Copilot April 29, 2026 18:12
@jeduden jeduden added the queue:active Applied automatically when a PR is in an active batch label Apr 29, 2026
@jeduden

jeduden commented Apr 29, 2026

Copy link
Copy Markdown
Owner

🟢 Merge Queue — picked up

This PR is in the queue and will be batched with other queue-labelled PRs.

Next: No action needed — you'll get another comment when CI starts on the batch. View merge queue run.

@jeduden jeduden added queue:failed Applied automatically when CI fails or merge conflict occurs and removed queue:active Applied automatically when a PR is in an active batch labels Apr 29, 2026
@jeduden

jeduden commented Apr 29, 2026

Copy link
Copy Markdown
Owner

⚠️ Merge Queue — merge conflict

This PR could not be merged into the batch branch without conflicts with main or another queued PR.

Next: Rebase onto or merge main into your branch, resolve conflicts, push, then re-add the queue label.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 20 changed files in this pull request and generated 5 comments.

---
# Bad nested with wrong inner marker

Outer uses dash (correct), inner should use asterisk but uses dash.

Copilot AI Apr 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is in fixed/ but the explanatory sentence still says the inner list "uses dash" even though the content has been fixed to * at depth 1. Updating the prose to match the fixed output (or making it neutral) would keep fixtures self-consistent.

Suggested change
Outer uses dash (correct), inner should use asterisk but uses dash.
Outer uses dash (correct), and the inner list uses asterisk.

Copilot uses AI. Check for mistakes.
Comment thread go.mod
github.com/neurosnap/sentences v1.1.2
github.com/spf13/pflag v1.0.10
github.com/stretchr/testify v1.11.1
github.com/tetratelabs/wazero v1.11.0

Copilot AI Apr 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

github.com/tetratelabs/wazero is now listed as a direct dependency, but the only imports in this repo appear to be in build-tagged/ignored spike code (e.g., internal/rules/concisenessscoring/wasmclassifier/embed.go has //go:build spike_wasm_classifier). Unless MDS045 requires wazero (it doesn’t), this looks like an accidental go mod tidy side effect; consider reverting this change or moving the dependency management to the spike/tooling workflow so the main module deps stay minimal.

Suggested change
github.com/tetratelabs/wazero v1.11.0

Copilot uses AI. Check for mistakes.
Comment on lines +5 to +7
# Bad plus with dash config

This list uses plus but dash is configured.

Copilot AI Apr 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is under fixed/ (expected post-fix output), but the heading/body text still describes the pre-fix state ("uses plus but dash is configured") even though the list items have been rewritten to -. Consider updating the prose/title to match the fixed output (or make it neutral) to avoid confusing future readers.

Suggested change
# Bad plus with dash config
This list uses plus but dash is configured.
# Dash list with dash config
This list uses dashes because dash is configured.

Copilot uses AI. Check for mistakes.
Comment on lines +5 to +7
# Bad dash with asterisk config

This list uses dashes but asterisk is configured.

Copilot AI Apr 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixed/ fixture’s heading/body text still describes the bad input ("uses dashes but asterisk is configured") even though the content has already been fixed to * markers. Updating the prose/title to reflect the post-fix state (or removing the claim) would prevent confusion when inspecting fixtures.

Suggested change
# Bad dash with asterisk config
This list uses dashes but asterisk is configured.
# Fixed asterisk list marker style
This list uses asterisk markers as configured.

Copilot uses AI. Check for mistakes.
Comment on lines +5 to +7
# Bad asterisk with dash config

This list uses asterisks but dash is configured.

Copilot AI Apr 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixed/ fixture’s description claims the list "uses asterisks" even though the markers have been fixed to -. Consider adjusting the heading/body text so the fixture reads as fixed output (or use neutral wording).

Suggested change
# Bad asterisk with dash config
This list uses asterisks but dash is configured.
# Fixed dash list with dash config
This list uses dashes as configured.

Copilot uses AI. Check for mistakes.
@jeduden jeduden added queue:active Applied automatically when a PR is in an active batch and removed queue:failed Applied automatically when CI fails or merge conflict occurs labels Apr 30, 2026
@jeduden

jeduden commented Apr 30, 2026

Copy link
Copy Markdown
Owner

🟢 Merge Queue — picked up

This PR is in the queue and will be batched with other queue-labelled PRs.

Next: No action needed — you'll get another comment when CI starts on the batch. View merge queue run.

@jeduden jeduden removed the queue:active Applied automatically when a PR is in an active batch label Apr 30, 2026
@jeduden jeduden added the queue:failed Applied automatically when CI fails or merge conflict occurs label Apr 30, 2026
@jeduden

jeduden commented Apr 30, 2026

Copy link
Copy Markdown
Owner

⚠️ Merge Queue — merge conflict

This PR could not be merged into the batch branch without conflicts with main or another queued PR.

Next: Rebase onto or merge main into your branch, resolve conflicts, push, then re-add the queue label.

@jeduden jeduden added queue:active Applied automatically when a PR is in an active batch and removed queue:failed Applied automatically when CI fails or merge conflict occurs labels May 2, 2026
@jeduden

jeduden commented May 2, 2026

Copy link
Copy Markdown
Owner

🟢 Merge Queue — picked up

This PR is in the queue and will be batched with other queue-labelled PRs.

Next: No action needed — you'll get another comment when CI starts on the batch. View merge queue run.

@jeduden jeduden added queue Add to a PR to enqueue it and removed queue:active Applied automatically when a PR is in an active batch labels May 2, 2026
@jeduden

jeduden commented May 2, 2026

Copy link
Copy Markdown
Owner

Merge Queue — requeued

The merge queue hit a transient error while processing this PR:

batch creation failed: merging PR #195: git merge failed (exit 2): error: Your local changes to the following files would be overwritten by merge: PLAN.md internal/rules/index.md Please commit your changes or stash them be…

View merge queue run.

Next: No action needed — the queue will retry automatically on the next run.

@jeduden

jeduden commented May 2, 2026

Copy link
Copy Markdown
Owner

Merge Queue — requeued

The merge queue hit a transient error while processing this PR:

merging PR #206: git merge failed (exit 2): error: Your local changes to the following files would be overwritten by merge: PLAN.md Please commit your changes or stash them before you merge. Aborting…

View merge queue run.

Next: No action needed — the queue will retry automatically on the next run.

@jeduden jeduden added queue:active Applied automatically when a PR is in an active batch and removed queue Add to a PR to enqueue it labels May 2, 2026
@jeduden

jeduden commented May 2, 2026

Copy link
Copy Markdown
Owner

🟢 Merge Queue — picked up

This PR is in the queue and will be batched with other queue-labelled PRs.

Next: No action needed — you'll get another comment when CI starts on the batch. View merge queue run.

jeduden pushed a commit that referenced this pull request May 2, 2026
@jeduden

jeduden commented May 2, 2026

Copy link
Copy Markdown
Owner

🔵 Merge Queue — CI running

Merged into batch branch merge-queue/batch-206-1777714909. View CI run.

Next: No action needed — you'll be notified when CI completes.

@jeduden jeduden added queue:failed Applied automatically when CI fails or merge conflict occurs and removed queue:active Applied automatically when a PR is in an active batch labels May 2, 2026
@jeduden

jeduden commented May 2, 2026

Copy link
Copy Markdown
Owner

Merge Queue — CI failed

The batch CI run failed with this PR in it.

Next: Fix the failure, push updates, then re-add the queue label to retry.

@jeduden jeduden removed the queue:failed Applied automatically when CI fails or merge conflict occurs label May 2, 2026
@jeduden

jeduden commented May 2, 2026

Copy link
Copy Markdown
Owner

🔍 Merge Queue — bisecting

A larger batch failed CI. Bisection is isolating the culprit: this run tests up to 2 of 4 candidate PRs on merge-queue/batch-bisect-195-1777748428. View current bisect CI run.

Next: No action needed — you'll be notified when the culprit is isolated or this PR merges.

@jeduden

jeduden commented May 2, 2026

Copy link
Copy Markdown
Owner

🔍 Merge Queue — bisecting

A larger batch failed CI. Bisection is isolating the culprit: this run tests up to 1 of 2 candidate PRs on merge-queue/batch-bisect-206-1777748624. View current bisect CI run.

Next: No action needed — you'll be notified when the culprit is isolated or this PR merges.

@jeduden

jeduden commented May 2, 2026

Copy link
Copy Markdown
Owner

Merge Queue — merged

This PR landed on main via commit dcb8061. CI run that validated the merge.

Next: Done — nothing more to do here.

@jeduden
jeduden merged commit dcb8061 into main May 2, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants