ruff/crates/ruff_python_formatter/tests
Andrew Gallant b6fb972e6f
config: add new `docstring-code-format` knob (#8854)
This PR does the plumbing to make a new formatting option,
`docstring-code-format`, available in the configuration for end users.
It is disabled by default (opt-in). It is opt-in at least initially to
reflect a conservative posture. The intent is to make it opt-out at some
point in the future.

This was split out from #8811 in order to make #8811 easier to merge.
Namely, once this is merged, docstring code snippet formatting will
become available to end users. (See comments below for how we arrived at
the name.)

Closes #7146

## Test Plan

Other than the standard test suite, I ran the formatter over the CPython
and polars projects to ensure both that the result looked sensible and
that tests still passed. At time of writing, one issue that currently
appears is that reformatting code snippets trips the long line lint:
https://github.com/BurntSushi/polars/actions/runs/7006619426/job/19058868021
2023-12-13 11:02:11 -05:00
..
snapshots config: add new `docstring-code-format` knob (#8854) 2023-12-13 11:02:11 -05:00
fixtures.rs ruff_python_formatter: implement "dynamic" line width mode for docstring code formatting (#9098) 2023-12-12 09:58:07 -05:00
normalizer.rs ruff_python_formatter: support reformatting Markdown code blocks (#9030) 2023-12-07 14:30:43 -05:00