Skip to content

style: use mdformat to format Markdown#5209

Draft
njzjz wants to merge 7 commits intodeepmodeling:masterfrom
njzjz:mdformat
Draft

style: use mdformat to format Markdown#5209
njzjz wants to merge 7 commits intodeepmodeling:masterfrom
njzjz:mdformat

Conversation

@njzjz
Copy link
Member

@njzjz njzjz commented Feb 8, 2026

No description provided.

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@ustc.edu.cn>
Copilot AI review requested due to automatic review settings February 8, 2026 18:52
@njzjz njzjz marked this pull request as draft February 8, 2026 18:52
@gemini-code-assist
Copy link

Summary of Changes

Hello @njzjz, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request streamlines the project's code style enforcement by standardizing Markdown formatting through the introduction of mdformat. This change ensures consistent styling across all Markdown files by leveraging a dedicated tool with a suite of specialized plugins, thereby improving readability and maintainability. It also refines the responsibilities of existing formatting tools within the pre-commit hooks.

Highlights

  • Markdown Formatting Tool Change: The pre-commit configuration has been updated to use mdformat for Markdown file formatting, replacing the previous blacken-docs hook and removing Markdown from prettier's scope.
  • Enhanced Markdown Capabilities: mdformat has been configured with several plugins, including mdformat-myst, mdformat-ruff, mdformat-web, mdformat-config, mdformat-beautysh, and mdformat-gfm-alerts, to provide comprehensive and specialized Markdown styling.
  • Prettier Scope Adjustment: The prettier pre-commit hook has been modified to no longer process Markdown files, ensuring that mdformat is the sole tool responsible for Markdown styling.
Changelog
  • .pre-commit-config.yaml
    • Removed the blacken-docs pre-commit hook, which was previously used for formatting Python code within documentation.
    • Added the mdformat pre-commit hook (version 1.0.0) to handle Markdown file formatting.
    • Configured mdformat with additional dependencies: mdformat-myst==0.3.0, mdformat-ruff==0.1.3, mdformat-web==0.2.0, mdformat-config==0.2.1, mdformat-beautysh==1.0.0, and mdformat-gfm-alerts==2.0.0.
    • Updated the prettier pre-commit hook to exclude Markdown files from its processing types, delegating this responsibility to mdformat.
Activity
  • No specific activity (comments, reviews, progress updates) has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the pre-commit configuration to use mdformat for formatting Markdown files, replacing blacken-docs. This is a positive change, as mdformat offers more extensive formatting capabilities and plugins. However, I've identified a critical issue with the specified version for mdformat that will cause the pre-commit hook to fail. My review includes a suggestion to fix this.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the repo’s formatting tooling by switching Markdown formatting in pre-commit from blacken-docs/prettier coverage to mdformat, aiming to standardize Markdown style as part of the project’s lint/format pipeline.

Changes:

  • Replace blacken-docs with an mdformat pre-commit hook plus several mdformat-* plugins.
  • Remove Markdown from the prettier hook’s types_or so Markdown is handled by mdformat.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member Author

@njzjz njzjz left a comment

Choose a reason for hiding this comment

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

It's currently blocked by executablebooks/mdformat-myst#13 and I have to use a developing version of mdformat-myst.

@codecov
Copy link

codecov bot commented Feb 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.99%. Comparing base (9465d71) to head (e310deb).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5209      +/-   ##
==========================================
- Coverage   81.99%   81.99%   -0.01%     
==========================================
  Files         724      724              
  Lines       73806    73807       +1     
  Branches     3615     3615              
==========================================
- Hits        60520    60519       -1     
- Misses      12123    12125       +2     
  Partials     1163     1163              

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment on lines 103 to 107
```{eval-rst}
.. dargs::
:module: deepmd.utils.argcheck
:func: gen_args_multi_task
:module: deepmd.utils.argcheck
:func: gen_args_multi_task
```
Copy link
Member Author

Choose a reason for hiding this comment

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

This is not correct.

Copy link
Member Author

Choose a reason for hiding this comment

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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant