-
Notifications
You must be signed in to change notification settings - Fork 590
style: re-enable cmake-format JSON formatter #5210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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>
Summary of ChangesHello @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 Highlights
Changelog
Activity
Using Gemini Code AssistThe 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
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 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
|
for more information, see https://pre-commit.ci
There was a problem hiding this 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.
📝 WalkthroughWalkthroughThe clang-format exclude regex in the pre-commit configuration was narrowed to only exclude JSON files under Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this 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-formatexclusion rules to stop globally excluding all.json. - Adds a targeted exclusion for
source/tests/infer/*.jsonto 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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
#4467 disabled the JSON formatter. Now it is turned on again, but ignores files added by #4467.
Summary by CodeRabbit