Add --range option to ruff format (#9733)

Co-authored-by: T-256 <132141463+T-256@users.noreply.github.com>
This commit is contained in:
Micha Reiser
2024-02-05 20:21:45 +01:00
committed by GitHub
parent e708c08b64
commit b3dc565473
7 changed files with 652 additions and 20 deletions

View File

@@ -654,7 +654,7 @@ Options:
Enable preview mode; enables unstable formatting. Use `--no-preview`
to disable
-h, --help
Print help
Print help (see more with '--help')
Miscellaneous:
-n, --no-cache
@@ -679,6 +679,14 @@ File selection:
Format configuration:
--line-length <LINE_LENGTH> Set the line-length
Editor options:
--range <RANGE> When specified, Ruff will try to only format the code in
the given range.
It might be necessary to extend the start backwards or
the end forwards, to fully enclose a logical line.
The `<RANGE>` uses the format
`<start_line>:<start_column>-<end_line>:<end_column>`.
Log levels:
-v, --verbose Enable verbose logging
-q, --quiet Print diagnostics, but nothing else