[pyflakes] Update docs to describe WAI behavior (F541) (#11362)

Addresses this comment:
https://github.com/astral-sh/ruff/issues/11357#issuecomment-2104714029


## Summary

The docs for F541 did not mention some surprising, but WAI, behavior
regarding implicit string concatenation. Update the docs to describe the
behavior.

Here's how things rendered for me locally:


![image](32067121-b190-4268-b987-ff37df11a618)
This commit is contained in:
Douglas Thor 2024-05-10 12:10:34 -07:00 committed by GitHub
parent f79c980e17
commit 0726e82342
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 23 additions and 0 deletions

View file

@ -29,6 +29,28 @@ use crate::checkers::ast::Checker;
/// "Hello, world!"
/// ```
///
/// **Note:** to maintain compatibility with PyFlakes, this rule only flags
/// f-strings that are part of an implicit concatenation if _none_ of the
/// f-string segments contain placeholder expressions.
///
/// For example:
///
/// ```python
/// # Will not be flagged.
/// (
/// f"Hello,"
/// f" {name}!"
/// )
///
/// # Will be flagged.
/// (
/// f"Hello,"
/// f" World!"
/// )
/// ```
///
/// See [#10885](https://github.com/astral-sh/ruff/issues/10885) for more.
///
/// ## References
/// - [PEP 498](https://www.python.org/dev/peps/pep-0498/)
#[violation]

View file

@ -39,6 +39,7 @@ KNOWN_FORMATTING_VIOLATIONS = [
"blank-lines-before-nested-definition",
"blank-lines-top-level",
"explicit-string-concatenation",
"f-string-missing-placeholders",
"indent-with-spaces",
"indentation-with-invalid-multiple",
"line-too-long",