ruff_python_formatter: add docstring-code-line-width internal setting (#9055)
## Summary This does the light plumbing necessary to add a new internal option that permits setting the line width of code examples in docstrings. The plan is to add the corresponding user facing knob in #8854. Note that this effectively removes the `same-as-global` configuration style discussed [in this comment](https://github.com/astral-sh/ruff/issues/8855#issuecomment-1847230440). It replaces it with the `{integer}` configuration style only. There are a lot of commits here, but they are each tiny to make review easier because of the changes to snapshots. ## Test Plan I added a new docstring test configuration that sets `docstring-code-line-width = 60` and examined the differences.
This commit is contained in:
@@ -464,6 +464,7 @@ impl<'ast, 'buf, 'fmt, 'src> DocstringLinePrinter<'ast, 'buf, 'fmt, 'src> {
|
||||
.f
|
||||
.options()
|
||||
.clone()
|
||||
.with_line_width(self.f.options().docstring_code_line_width())
|
||||
// It's perhaps a little odd to be hard-coding the indent
|
||||
// style here, but I believe it is necessary as a result
|
||||
// of the whitespace normalization otherwise done in
|
||||
|
||||
Reference in New Issue
Block a user