Preview Style: Format module level docstring (#9725)

Co-authored-by: Micha Reiser <micha@reiser.io>
This commit is contained in:
Shaygan Hooshyari 2024-02-05 16:03:34 +01:00 committed by GitHub
parent 80fc02e7d5
commit b47f85eb69
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 30 additions and 143 deletions

View file

@ -74,3 +74,10 @@ pub(crate) const fn is_hex_codes_in_unicode_sequences_enabled(context: &PyFormat
pub(crate) const fn is_multiline_string_handling_enabled(context: &PyFormatContext) -> bool {
context.is_preview()
}
/// Returns `true` if the [`multiline_string_handling`](https://github.com/astral-sh/ruff/pull/9725) preview style is enabled.
/// Black does not [`format docstrings`](https://github.com/psf/black/issues/3493) so we keep this
/// preview for compatibility with Black.
pub(crate) const fn is_format_module_docstring_enabled(context: &PyFormatContext) -> bool {
context.is_preview()
}