add new chinese translations
This commit is contained in:
33
pages.zh/common/ruff-check.md
Normal file
33
pages.zh/common/ruff-check.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# ruff 检查
|
||||
|
||||
> 一个极快的 Python 代码检查工具。`check` 是默认命令 - 可以在任何地方省略。
|
||||
> 如果没有指定文件或目录,则默认使用当前工作目录。
|
||||
> 更多信息:<https://docs.astral.sh/ruff/linter>。
|
||||
|
||||
- 在指定的文件或目录上运行 linter:
|
||||
|
||||
`ruff check {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
|
||||
|
||||
- 应用建议的修复,直接修改文件:
|
||||
|
||||
`ruff check --fix`
|
||||
|
||||
- 运行 linter 并在更改时重新检查:
|
||||
|
||||
`ruff check --watch`
|
||||
|
||||
- 仅启用指定的规则(或所有规则),忽略配置文件:
|
||||
|
||||
`ruff check --select {{ALL|rule_code1,rule_code2,...}}`
|
||||
|
||||
- 另外启用指定的规则:
|
||||
|
||||
`ruff check --extend-select {{rule_code1,rule_code2,...}}`
|
||||
|
||||
- 禁用指定的规则:
|
||||
|
||||
`ruff check --ignore {{rule_code1,rule_code2,...}}`
|
||||
|
||||
- 通过在所有违反规则的行添加 `# noqa` 指令来忽略该规则所有现有的违规行为:
|
||||
|
||||
`ruff check --select {{rule_code}} --add-noqa`
|
Reference in New Issue
Block a user