You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
expected="\n".join(
[
"=== long text ======================================================================",
"=== long text ======================================================================",
],
)
ruff scratch.py
scratch.py:1:12: FLY002 [*] Consider `"=== long text ======================================================================\n=== long text ======================================================================"` instead of string join
Found 1 errors.
[*] 1 potentially fixable with the --fix option.
ruff scratch.py --fix
scratch.py:1:99: E501 Line too long (183 > 98 characters)
Found 1 errors (1 fixed, 0 remaining).
The text was updated successfully, but these errors were encountered:
I think in this case it's best to use a noqa comment. We used to consider the line length for some rules but this can lead to undesired false-negatives because it's far from a good metric for complexity.
Another alternative here, but it requires human intervention, is to use a multiline string instead.
Applying FLY002 to the code creates a code that does not pass
E501 Line too long
This check is mentioned in the #2102
Code sample:
ruff scratch.py --fix scratch.py:1:99: E501 Line too long (183 > 98 characters) Found 1 errors (1 fixed, 0 remaining).
The text was updated successfully, but these errors were encountered: