Skip to content

use mdformat to format Markdown#940

Closed
njzjz-bot wants to merge 1 commit intodeepmodeling:develfrom
njzjz-bothub:use-mdformat
Closed

use mdformat to format Markdown#940
njzjz-bot wants to merge 1 commit intodeepmodeling:develfrom
njzjz-bothub:use-mdformat

Conversation

@njzjz-bot
Copy link
Contributor

@njzjz-bot njzjz-bot commented Feb 23, 2026

Follow up deepmodeling/deepmd-kit@69eb0c3, use mdformat to format Markdown.

  • Replace blacken-docs with mdformat

Summary by CodeRabbit

  • Chores
    • Updated development configuration to enhance code and markdown formatting capabilities.

Authored by OpenClaw (model: glm-5)
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Feb 23, 2026
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 24, 2026

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

✅ 2 untouched benchmarks
⏩ 2 skipped benchmarks1


Comparing njzjz-bothub:use-mdformat (9e9fcba) with devel (d6b44e7)

Open in CodSpeed

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@coderabbitai
Copy link

coderabbitai bot commented Feb 24, 2026

📝 Walkthrough

Walkthrough

The .pre-commit-config.yaml is updated to replace the blacken-docs hook with mdformat for Markdown formatting. The mdformat hook (version 1.0.0) is configured with multiple plugins including mdformat-myst, mdformat-ruff, mdformat-web, mdformat-config, mdformat-beautysh, and mdformat-gfm-alerts.

Changes

Cohort / File(s) Summary
Pre-commit Configuration
.pre-commit-config.yaml
Removed blacken-docs hook and added mdformat hook (v1.0.0) with six additional dependencies for Markdown formatting across various formats and linting integrations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'use mdformat to format Markdown' directly describes the main change: replacing blacken-docs with mdformat for Markdown formatting in pre-commit configuration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.pre-commit-config.yaml:
- Around line 43-45: The pre-commit config currently fetches mdformat-myst from
an unofficial git fork using the dependency string
"git+https://github.com/njzjz-bothub/mdformat-myst@d9c414e", which is a
supply-chain risk; replace this git+ URL with the official PyPI release
"mdformat-myst==0.3.0" (or a documented, signed internal package name) and add a
short comment explaining the temporary decision, or if the fork is required
long-term, publish the patched fork to PyPI (or an internal index) and update
the dependency to that published package name so CI and scanners can verify
artifacts.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d6b44e7 and 9e9fcba.

📒 Files selected for processing (1)
  • .pre-commit-config.yaml

Comment on lines +43 to +45
# - mdformat-myst==0.3.0
# See https://github.com/executablebooks/mdformat-myst/issues/13
- "git+https://github.com/njzjz-bothub/mdformat-myst@d9c414e#egg=mdformat-myst"
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Fetch commit d9c414e details from the fork
curl -s "https://api.github.com/repos/njzjz-bothub/mdformat-myst/commits/d9c414e" | jq -r '{sha: .sha, message: .commit.message, author_name: .commit.author.name, date: .commit.author.date, url: .html_url}'

Repository: deepmodeling/dpdata

Length of output: 731


🌐 Web query:

executablebooks mdformat-myst issue #13 status 2025 2026

💡 Result:

executablebooks/mdformat-myst Issue #13 (“colon fence syntax is broken by escape character”) is still Open as of February 24, 2026. It was opened Nov 29, 2021 by @arwedus, labeled enhancement, with no assignee, milestone, or linked PRs shown on the issue page. [1]


🌐 Web query:

mdformat-myst pypi latest version releases

💡 Result:

mdformat-myst (PyPI) latest version: 0.3.0 — released Nov 27, 2025. [1]

Recent releases (newest → oldest): [1]

  • 0.3.0 — Nov 27, 2025
  • 0.2.2 — Aug 19, 2025
  • 0.2.1 — Nov 14, 2024
  • 0.2.0 — Oct 16, 2024
  • 0.1.5 — Feb 2, 2022
  • 0.1.4 — Jun 23, 2021

Install: pip install mdformat-myst [1]

Sources: [1]


Supply-chain risk: git+ fork dependency for mdformat-myst

Installing a package via git+https://github.com/njzjz-bothub/mdformat-myst@d9c414e bypasses PyPI's artifact integrity checks and vulnerability scanning pipeline. Even though the dependency is pinned to a specific commit hash, it pulls from an unofficial, unpublished fork rather than the verified PyPI release (0.3.0, released Nov 27, 2025). This is a meaningful supply-chain risk for any project contributor or CI runner that consumes this pre-commit config.

The commit fixes an indentation preservation issue for non-MyST directive content (as described in its message), which is different from the original issue #13 (colon fence syntax broken by escape character) that remains unresolved upstream. Consider:

  • Tracking when upstream resolves the underlying issues and reverting to the official PyPI release.
  • If the fork must be used long-term, consider formally publishing the patched version to PyPI under a scoped name to improve transparency and enable vulnerability scanning.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.pre-commit-config.yaml around lines 43 - 45, The pre-commit config
currently fetches mdformat-myst from an unofficial git fork using the dependency
string "git+https://github.com/njzjz-bothub/mdformat-myst@d9c414e", which is a
supply-chain risk; replace this git+ URL with the official PyPI release
"mdformat-myst==0.3.0" (or a documented, signed internal package name) and add a
short comment explaining the temporary decision, or if the fork is required
long-term, publish the patched fork to PyPI (or an internal index) and update
the dependency to that published package name so CI and scanners can verify
artifacts.

@njzjz-bot
Copy link
Contributor Author

pre-commit.ci autofix

@njzjz-bot njzjz-bot closed this Feb 24, 2026
@codecov
Copy link

codecov bot commented Feb 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.37%. Comparing base (d6b44e7) to head (9e9fcba).

Additional details and impacted files
@@           Coverage Diff           @@
##            devel     #940   +/-   ##
=======================================
  Coverage   86.37%   86.37%           
=======================================
  Files          86       86           
  Lines        8086     8086           
=======================================
  Hits         6984     6984           
  Misses       1102     1102           

☔ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant