Skip to content

Conversation

@njzjz
Copy link
Member

@njzjz njzjz commented Feb 8, 2026

#4467 disabled the JSON formatter. Now it is turned on again, but ignores files added by #4467.

Summary by CodeRabbit

  • Chores
    • Refined formatting configuration to apply formatter to more JSON files (narrower exclusions).
    • Reformatted JSON content for readability without changing any data or behavior.

deepmodeling#4467 disabled the JSON formatter. Now it is turned on again, but ignores files added by deepmodeling#4467.

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@ustc.edu.cn>
Copilot AI review requested due to automatic review settings February 8, 2026 19:49
@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 re-enables JSON formatting via the clang-format pre-commit hook by narrowing the scope of excluded JSON files. This ensures that most JSON files are now subject to automatic formatting, while specific test-related JSON files remain excluded as intended by a previous change (#4467).

Highlights

  • JSON Formatting Re-enabled: The clang-format pre-commit hook has been re-configured to format JSON files. Previously, all JSON files were excluded, but now only JSON files located within source/tests/infer/ are excluded from clang-format.
  • Exclusion Scope Narrowed: The exclude pattern for the clang-format hook in .pre-commit-config.yaml was updated to specifically target JSON files in source/tests/infer/, thereby allowing other JSON files to be formatted automatically.
Changelog
  • .pre-commit-config.yaml
    • Updated the clang-format hook's exclude pattern to re-enable JSON formatting for files outside source/tests/infer/.
Activity
  • The author njzjz created this pull request to address a previous change (pd: add CPP inference with LAMMPS #4467) that had disabled JSON formatting.
  • The pull request modifies the .pre-commit-config.yaml file to adjust the clang-format exclusion rules, specifically for JSON files.
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 correctly re-enables the JSON formatter in the pre-commit configuration. The change narrows the exclusion scope for clang-format from all .json files to only those under source/tests/infer/. This aligns with the stated goal of ignoring specific files while applying formatting to other JSON files. The modification to the regular expression is accurate and effectively implements the intended behavior.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 8, 2026

📝 Walkthrough

Walkthrough

The clang-format exclude regex in the pre-commit configuration was narrowed to only exclude JSON files under source/tests/infer, and a single example JSON file (examples/water_multi_task/pytorch_example/input_torch_with_alias.json) was reformatted (whitespace/line breaks only).

Changes

Cohort / File(s) Summary
Pre-commit Configuration
.pre-commit-config.yaml
Tightened the clang-format exclude pattern from excluding all *.json to excluding only source/tests/infer/*.json.
Example JSON (formatting only)
examples/water_multi_task/pytorch_example/input_torch_with_alias.json
Reformatted JSON arrays (expanded short arrays across multiple lines); no semantic or data changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • wanghan-iapcm
🚥 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 clearly and specifically describes the main change: re-enabling the cmake-format JSON formatter, which aligns with the PR objectives.
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

No actionable comments were generated in the recent review. 🎉


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.

@njzjz njzjz requested a review from wanghan-iapcm February 8, 2026 19:51
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

Re-enables JSON formatting in the repo’s formatting workflow while exempting JSON fixtures introduced by #4467 from being reformatted.

Changes:

  • Reformats a JSON example file into a multi-line, consistent style.
  • Updates pre-commit’s clang-format exclusion rules to stop globally excluding all .json.
  • Adds a targeted exclusion for source/tests/infer/*.json to preserve those files’ formatting.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
examples/water_multi_task/pytorch_example/input_torch_with_alias.json Applies JSON formatting changes (multi-line arrays / consistent indentation).
.pre-commit-config.yaml Narrows the JSON exclusion to source/tests/infer to allow formatting elsewhere.

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

@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 (d798b33) to head (cc0669c).
⚠️ Report is 61 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5210      +/-   ##
==========================================
- Coverage   83.78%   81.99%   -1.79%     
==========================================
  Files         709      724      +15     
  Lines       86033    73806   -12227     
  Branches     3616     3615       -1     
==========================================
- Hits        72084    60520   -11564     
+ Misses      12787    12123     -664     
- Partials     1162     1163       +1     

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

@wanghan-iapcm wanghan-iapcm added this pull request to the merge queue Feb 9, 2026
Merged via the queue into deepmodeling:master with commit 03fccc4 Feb 9, 2026
70 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants