Ruff introduced a new parameter --range that allows the formatter to only check the specified range. This would be useful to allow migrating from black to ruff formatting without causing whole-file diffs whenever a file is touched for the first time.
Quote from docs:
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>`.
Is there a way to have range support within the pre-commit framework?
Ruff introduced a new parameter
--rangethat allows the formatter to only check the specified range. This would be useful to allow migrating from black to ruff formatting without causing whole-file diffs whenever a file is touched for the first time.Quote from docs:
Is there a way to have range support within the pre-commit framework?