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:
Andrew Gallant 2023-12-11 08:20:59 -05:00 committed by GitHub
parent 3aa6a30395
commit 07380e0657
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 1728 additions and 296 deletions

View file

@ -38,5 +38,11 @@
"docstring_code": "enabled",
"indent_style": "tab",
"indent_width": 4
},
{
"docstring_code": "enabled",
"docstring_code_line_width": 60,
"indent_style": "space",
"indent_width": 4
}
]