You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在GitHub Actions中启用最严格的ruff check检测

在GitHub Actions中启用最严格的Ruff检测(等效于ruff check --select ALL)

要实现和ruff check --select ALL完全等效的严格检测,只需在GitHub Actions的ruff-action配置中添加args参数并指定--select ALL即可,具体配置示例如下:

针对指定文件的配置

- uses: astral-sh/ruff-action@v3
  with:
    src: >-
      path/to/file1.py
      path/to/file2.py
    args: "--select ALL"

针对整个仓库的配置

如果需要扫描仓库中所有Python文件,可以省略src字段:

- uses: astral-sh/ruff-action@v3
  with:
    args: "--select ALL"

添加--select ALL参数后,Ruff会启用所有可用的检测规则,包括默认未开启的规则(比如尾随空格检测),完全匹配本地执行ruff check --select ALL的检测效果。

内容的提问来源于stack exchange,提问作者Timur Shtatland

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.12 16:10:53