Skip to content

feat: 添加ruff-pre-commit指引 - #2514

Merged
ShadowLemoon merged 3 commits into
OneDragon-Anything:mainfrom
Usagi-wusaqi:feat/ruff-pre-commit
Jul 20, 2026
Merged

feat: 添加ruff-pre-commit指引#2514
ShadowLemoon merged 3 commits into
OneDragon-Anything:mainfrom
Usagi-wusaqi:feat/ruff-pre-commit

Conversation

@Usagi-wusaqi

@Usagi-wusaqi Usagi-wusaqi commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

close #2208

Summary by CodeRabbit

Summary by CodeRabbit

  • 工具与流程

    • 新增提交前的代码检查与自动格式化能力(含可自动修复)。
    • 提交前检查仅处理本次提交相关的变更文件,避免全量扫描。
    • 更新开发依赖以支持提交前检查流程。
  • 文档

    • 补充启用与运行提交前检查的示例:如何安装、以及如何按本次修改文件执行检查/格式化。

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3e07bea7-dfba-46ef-b431-88380791c44b

📥 Commits

Reviewing files that changed from the base of the PR and between 2d3eb82 and 5232591.

📒 Files selected for processing (2)
  • .pre-commit-config.yaml
  • docs/develop/spec/agent_guidelines.md
💤 Files with no reviewable changes (1)
  • .pre-commit-config.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/develop/spec/agent_guidelines.md

📝 Walkthrough

Walkthrough

新增基于 Ruff 的 pre-commit 检查配置,加入 pre-commit 开发依赖,并更新开发指南中的安装、执行及文件范围说明。

Changes

提交前检查工作流

Layer / File(s) Summary
提交前检查配置与说明
.pre-commit-config.yaml, pyproject.toml, docs/develop/spec/agent_guidelines.md
新增固定版本的 Ruff ruff-check --fixruff-format 钩子,加入 pre-commit==4.6.0 开发依赖,并补充安装及仅检查本次修改文件的命令说明。

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题与变更内容一致,准确概括了新增 ruff-pre-commit 的配置与使用指引。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@ShadowLemoon
ShadowLemoon merged commit 940e667 into OneDragon-Anything:main Jul 20, 2026
8 checks passed
@Usagi-wusaqi
Usagi-wusaqi deleted the feat/ruff-pre-commit branch July 20, 2026 06:44
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jul 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

添加ruff-pre-commit指引

2 participants