Skip to content

Migrate markdown formatting from mdformat to dprint - #758

Merged
kmontemayor2-sc merged 2 commits into
mainfrom
kmonte/dprint-migration
Aug 24, 2026
Merged

Migrate markdown formatting from mdformat to dprint#758
kmontemayor2-sc merged 2 commits into
mainfrom
kmonte/dprint-migration

Conversation

@kmontemayor2-sc

Copy link
Copy Markdown
Collaborator

I found that dprint is much much faster (and supports more file types, we could do e.x. yaml formatting in the future too)

Replace mdformat/.mdformat.toml with dprint (dprint.json), matching the previous mdformat style as closely as dprint allows: lineWidth=120 with textWrap=always (mdformat wrap=120), asterisk emphasis, dash bullets, and table formatting built in. The mdformat exclusion list (MD_EXCLUDE_DIRS) moves into dprint.json excludes; the formatted markdown file set is byte-identical between the old find expression and dprint's resolution. dprint also picks up toml (pyproject reformats) and cmake (gigl-core CMakeLists reformats; cmake commands are case-insensitive).

Remaining one-time normalizations dprint applies that mdformat did not (no config knobs exist for these): thematic breaks ______ -> ---, task-list continuation lines aligned under content, blank lines around headings/lists, table column padding, and common-indent stripping inside code fences. Output is idempotent; make check_format_md passes.

The dprint CLI is provided by the dprint-py wheel (a thin PyPI repackaging of the official dprint binary) so the existing 'uv run' pattern keeps working.

Scope of work done

Where is the documentation for this feature?: N/A

Did you add automated tests or write a test plan?

Updated Changelog.md? NO

Ready for code review?: NO

Replace mdformat/.mdformat.toml with dprint (dprint.json), matching the
previous mdformat style as closely as dprint allows: lineWidth=120 with
textWrap=always (mdformat wrap=120), asterisk emphasis, dash bullets, and
table formatting built in. The mdformat exclusion list (MD_EXCLUDE_DIRS)
moves into dprint.json excludes; the formatted markdown file set is
byte-identical between the old find expression and dprint's resolution.
dprint also picks up toml (pyproject reformats) and cmake
(gigl-core CMakeLists reformats; cmake commands are case-insensitive).

Remaining one-time normalizations dprint applies that mdformat did not
(no config knobs exist for these): thematic breaks ______ -> ---,
task-list continuation lines aligned under content, blank lines around
headings/lists, table column padding, and common-indent stripping inside
code fences. Output is idempotent; make check_format_md passes.

The dprint CLI is provided by the dprint-py wheel (a thin PyPI
repackaging of the official dprint binary) so the existing 'uv run'
pattern keeps working.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@mkolodner-sc mkolodner-sc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks Kyle!

@mkolodner-sc mkolodner-sc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Just curious how much faster dprint is relative to mdformat?

@kmontemayor2-sc

Copy link
Copy Markdown
Collaborator Author

Just curious how much faster dprint is relative to mdformat?

I went from like 10s to 1s

@kmontemayor2-sc
kmontemayor2-sc marked this pull request as ready for review August 24, 2026 21:11
@kmontemayor2-sc
kmontemayor2-sc added this pull request to the merge queue Aug 24, 2026
Merged via the queue into main with commit a731c66 Aug 24, 2026
7 checks passed
@kmontemayor2-sc
kmontemayor2-sc deleted the kmonte/dprint-migration branch August 24, 2026 23:19
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.

3 participants