Skip to content

Conversation

@njzjz
Copy link
Member

@njzjz njzjz commented Dec 21, 2025

Previously, it was in ruff.lint.exclude, so exclusions were not applied to ruff format.

Summary by CodeRabbit

  • Chores
    • Updated development tooling configuration to enhance code quality standards and consistency checks.

✏️ Tip: You can customize this high-level summary in your review settings.

Previously, it was in `ruff.lint.exclude`, so exclusions were not applied
to `ruff format`.
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

This PR moves the Ruff exclusion configuration from ruff.lint.exclude to ruff.extend-exclude to ensure that exclusions apply to both linting and formatting operations.

Key Changes:

  • Added a new [tool.ruff] section with extend-exclude configuration
  • Removed the exclude configuration from [tool.ruff.lint] section

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 21, 2025

📝 Walkthrough

Walkthrough

The pull request modifies the Ruff configuration in pyproject.toml by adding an extend-exclude directive for third-party code and enabling docstring code formatting, while reorganizing the existing exclude configuration structure.

Changes

Cohort / File(s) Summary
Ruff configuration
pyproject.toml
Added [tool.ruff] section with extend-exclude = ["source/3rdparty/**"] and [tool.ruff.format] section with docstring-code-format = true; removed top-level exclude block

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Pre-merge checks and finishing touches

✅ 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 accurately summarizes the main change: moving Ruff excludes to the ruff.extend-exclude configuration, which matches the changeset in pyproject.toml.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 188dae3 and 7018823.

📒 Files selected for processing (1)
  • pyproject.toml (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
Repo: deepmodeling/deepmd-kit PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-12T13:40:14.334Z
Learning: Install and run ruff linter with `uv pip install ruff`, then run `ruff check .` and `ruff format .` before committing changes
Learnt from: CR
Repo: deepmodeling/deepmd-kit PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-12T13:40:14.334Z
Learning: Always run `ruff check . && ruff format .` before committing changes to ensure CI passes
📚 Learning: 2025-12-12T13:40:14.334Z
Learnt from: CR
Repo: deepmodeling/deepmd-kit PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-12T13:40:14.334Z
Learning: Install and run ruff linter with `uv pip install ruff`, then run `ruff check .` and `ruff format .` before committing changes

Applied to files:

  • pyproject.toml
📚 Learning: 2025-12-12T13:40:14.334Z
Learnt from: CR
Repo: deepmodeling/deepmd-kit PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-12T13:40:14.334Z
Learning: Always run `ruff check . && ruff format .` before committing changes to ensure CI passes

Applied to files:

  • pyproject.toml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (28)
  • GitHub Check: Build wheels for cp311-macosx_arm64
  • GitHub Check: Build wheels for cp311-manylinux_x86_64
  • GitHub Check: Build wheels for cp311-macosx_x86_64
  • GitHub Check: Build wheels for cp310-manylinux_aarch64
  • GitHub Check: Build wheels for cp311-win_amd64
  • GitHub Check: Test Python (2, 3.10)
  • GitHub Check: Test Python (4, 3.13)
  • GitHub Check: Test Python (5, 3.10)
  • GitHub Check: Test Python (1, 3.10)
  • GitHub Check: Test Python (4, 3.10)
  • GitHub Check: Build C library (2.18, libdeepmd_c.tar.gz)
  • GitHub Check: Test Python (5, 3.13)
  • GitHub Check: Test Python (2, 3.13)
  • GitHub Check: Test Python (6, 3.13)
  • GitHub Check: Analyze (c-cpp)
  • GitHub Check: Test Python (6, 3.10)
  • GitHub Check: Test Python (3, 3.10)
  • GitHub Check: Analyze (python)
  • GitHub Check: Test Python (3, 3.13)
  • GitHub Check: Test Python (1, 3.13)
  • GitHub Check: Build C++ (rocm, rocm)
  • GitHub Check: Build C++ (cuda120, cuda)
  • GitHub Check: Build C++ (cpu, cpu)
  • GitHub Check: Build C++ (clang, clang)
  • GitHub Check: Test C++ (true, true, true, false)
  • GitHub Check: Test C++ (false, false, false, true)
  • GitHub Check: Test C++ (true, false, false, true)
  • GitHub Check: Test C++ (false, true, true, false)
🔇 Additional comments (2)
pyproject.toml (2)

362-363: docstring-code-format is a stable feature for formatting code in docstrings.

Ruff v0.1.8 introduced opt-in support for formatting Python code examples in docstrings via the docstring-code-format setting. The formatter recognizes code examples in doctest format, CommonMark fenced code blocks with language identifiers, and fenced code blocks without labels. Enabling this feature is reasonable, though consider whether existing docstring code examples are formatted consistently before merging, as this will enforce formatting on them.


357-360: LGTM! The extend-exclude configuration correctly ensures source/3rdparty/** is excluded from both ruff check and ruff format.

The extend-exclude setting adds files and directories on top of those already excluded at the project level, achieving the stated PR objective. The docstring-code-format option in the formatter provides an opt-in feature for automatically formatting Python code examples in docstrings, and both settings are properly configured in the [tool.ruff] and [tool.ruff.format] sections respectively.


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.

@codecov
Copy link

codecov bot commented Dec 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.15%. Comparing base (188dae3) to head (7018823).
⚠️ Report is 2 commits behind head on devel.

Additional details and impacted files
@@           Coverage Diff           @@
##            devel    #5112   +/-   ##
=======================================
  Coverage   82.15%   82.15%           
=======================================
  Files         709      709           
  Lines       72470    72469    -1     
  Branches     3615     3615           
=======================================
  Hits        59536    59536           
+ Misses      11771    11770    -1     
  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.

@njzjz njzjz closed this Dec 22, 2025
@njzjz njzjz reopened this Dec 22, 2025
@wanghan-iapcm wanghan-iapcm added this pull request to the merge queue Dec 22, 2025
Merged via the queue into deepmodeling:devel with commit 0e883dc Dec 22, 2025
106 of 108 checks passed
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.

2 participants