File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
src/doc/rustc-dev-guide/src Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,26 @@ When modifying that code, use this command to format it:
4040This uses a pinned version of ` clang-format ` , to avoid relying on the local
4141environment.
4242
43+ ## Formatting and linting Python code
44+
45+ The rustc repository contains quite a lof of Python code. We try to keep
46+ it both linted and formatted by the [ ruff] [ ruff ] tool.
47+
48+ When modifying Python code, use this command to format it:
49+ ``` sh
50+ ./x test tidy --extra-checks=py:fmt --bless
51+ ```
52+
53+ and the following command to run lints:
54+ ``` sh
55+ ./x test tidy --extra-checks=py:lint
56+ ```
57+
58+ This uses a pinned version of ` ruff ` , to avoid relying on the local
59+ environment.
60+
61+ [ ruff ] : https://github.com/astral-sh/ruff
62+
4363<a id =" copyright " ></a >
4464
4565<!-- REUSE-IgnoreStart -->
You can’t perform that action at this time.
0 commit comments