mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-14 12:29:11 +00:00
![]() ## Summary At present, `quote-style` is used universally. However, [PEP 8](https://peps.python.org/pep-0008/) and [PEP 257](https://peps.python.org/pep-0257/) suggest that while either single or double quotes are acceptable in general (as long as they're consistent), docstrings and triple-quoted strings should always use double quotes. In our research, the vast majority of Ruff users that enable the `flake8-quotes` rules only enable them for inline strings (i.e., non-triple-quoted strings). Additionally, many Black forks (like Blue and Pyink) use double quotes for docstrings and triple-quoted strings. Our decision for now is to always prefer double quotes for triple-quoted strings (which should include docstrings). Based on feedback, we may consider adding additional options (e.g., a `"preserve"` mode, to avoid changing quotes; or a `"multiline-quote-style"` to override this). Closes https://github.com/astral-sh/ruff/issues/7615. ## Test Plan `cargo test` |
||
---|---|---|
.. | ||
binary_like.rs | ||
expr_attribute.rs | ||
expr_await.rs | ||
expr_bin_op.rs | ||
expr_bool_op.rs | ||
expr_call.rs | ||
expr_compare.rs | ||
expr_constant.rs | ||
expr_dict.rs | ||
expr_dict_comp.rs | ||
expr_f_string.rs | ||
expr_formatted_value.rs | ||
expr_generator_exp.rs | ||
expr_if_exp.rs | ||
expr_ipy_escape_command.rs | ||
expr_lambda.rs | ||
expr_list.rs | ||
expr_list_comp.rs | ||
expr_name.rs | ||
expr_named_expr.rs | ||
expr_set.rs | ||
expr_set_comp.rs | ||
expr_slice.rs | ||
expr_starred.rs | ||
expr_subscript.rs | ||
expr_tuple.rs | ||
expr_unary_op.rs | ||
expr_yield.rs | ||
expr_yield_from.rs | ||
mod.rs | ||
number.rs | ||
operator.rs | ||
parentheses.rs | ||
string.rs |