ruff check
An extremely fast Python linter.
checkis the default command - it can be omitted everywhere. If no files or directories are specified, the current working directory is used by default. More information: https://docs.astral.sh/ruff/linter/.
- Run the linter on the given files or directories:
ruff check
- Apply the suggested fixes, modifying the files in-place:
ruff check --fix
- Run the linter and re-lint on change:
ruff check --watch
- Only enable the specified rules (or all rules), ignoring the configuration file:
ruff check --select
- Additionally enable the specified rules:
ruff check --extend-select
- Disable the specified rules:
ruff check --ignore
- Ignore all existing violations of a rule by adding
# noqadirectives to all lines that violate it:
ruff check --select --add-noqa
来源:tldr-pages contributors · 作者与贡献记录 · CC BY 4.0。离线整理了版式、链接和媒体显示。
