Skip to content

CI: 添加 Python linter (ruff) 检查 #9

Description

@BukeLy

背景

Code review 中发现未使用的 import 等问题应该由自动化工具捕获,而非人工 review。

建议

在 CI 流程中添加 Python linter 检查:

  1. 工具选择: ruff - 快速、现代的 Python linter
  2. 检查规则:
    • F401: 未使用的 import
    • F841: 未使用的变量
    • E: 基础代码风格

实现方案

# .github/workflows/ci.yml
- name: Lint Python
  run: |
    pip install ruff
    ruff check .

参考

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions