---
source: crates/ruff_linter/src/rules/flake8_pyi/mod.rs
---
PYI053 [*] String and bytes literals longer than 50 characters are not permitted
 --> PYI053.pyi:7:14
  |
5 | def f1(x: str = "50 character stringggggggggggggggggggggggggggggggg") -> None: ...  # OK
6 | def f2(
7 |     x: str = "51 character stringgggggggggggggggggggggggggggggggg",  # Error: PYI053
  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8 | ) -> None: ...
9 | def f3(
  |
help: Replace with `...`
  |
6 | def f2(
  -     x: str = "51 character stringgggggggggggggggggggggggggggggggg",  # Error: PYI053
7 +     x: str = ...,  # Error: PYI053
8 | ) -> None: ...
  |

PYI053 [*] String and bytes literals longer than 50 characters are not permitted
  --> PYI053.pyi:13:14
   |
11 | ) -> None: ...
12 | def f4(
13 |     x: str = "51 character stringggggggggggggggggggggggggggggggg\U0001f600",  # Error: PYI053
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14 | ) -> None: ...
15 | def f5(
   |
help: Replace with `...`
   |
12 | def f4(
   -     x: str = "51 character stringggggggggggggggggggggggggggggggg\U0001f600",  # Error: PYI053
13 +     x: str = ...,  # Error: PYI053
14 | ) -> None: ...
   |

PYI053 [*] String and bytes literals longer than 50 characters are not permitted
  --> PYI053.pyi:25:16
   |
23 | ) -> None: ...
24 | def f8(
25 |     x: bytes = b"51 character byte stringgggggggggggggggggggggggggg\xff",  # Error: PYI053
   |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
26 | ) -> None: ...
   |
help: Replace with `...`
   |
24 | def f8(
   -     x: bytes = b"51 character byte stringgggggggggggggggggggggggggg\xff",  # Error: PYI053
25 +     x: bytes = ...,  # Error: PYI053
26 | ) -> None: ...
   |

PYI053 [*] String and bytes literals longer than 50 characters are not permitted
  --> PYI053.pyi:30:12
   |
28 | foo: str = "50 character stringggggggggggggggggggggggggggggggg"  # OK
29 |
30 | bar: str = "51 character stringgggggggggggggggggggggggggggggggg"  # Error: PYI053
   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
31 |
32 | baz: bytes = b"50 character byte stringgggggggggggggggggggggggggg"  # OK
   |
help: Replace with `...`
   |
29 |
   - bar: str = "51 character stringgggggggggggggggggggggggggggggggg"  # Error: PYI053
30 + bar: str = ...  # Error: PYI053
31 |
   |

PYI053 [*] String and bytes literals longer than 50 characters are not permitted
  --> PYI053.pyi:34:14
   |
32 | baz: bytes = b"50 character byte stringgggggggggggggggggggggggggg"  # OK
33 |
34 | qux: bytes = b"51 character byte stringggggggggggggggggggggggggggg\xff"  # Error: PYI053
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
35 |
36 | ffoo: str = f"50 character stringggggggggggggggggggggggggggggggg"  # OK
   |
help: Replace with `...`
   |
33 |
   - qux: bytes = b"51 character byte stringggggggggggggggggggggggggggg\xff"  # Error: PYI053
34 + qux: bytes = ...  # Error: PYI053
35 |
   |

PYI053 [*] String and bytes literals longer than 50 characters are not permitted
  --> PYI053.pyi:38:13
   |
36 | ffoo: str = f"50 character stringggggggggggggggggggggggggggggggg"  # OK
37 |
38 | fbar: str = f"51 character stringgggggggggggggggggggggggggggggggg"  # Error: PYI053
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
39 |
40 | class Demo:
   |
help: Replace with `...`
   |
37 |
   - fbar: str = f"51 character stringgggggggggggggggggggggggggggggggg"  # Error: PYI053
38 + fbar: str = ...  # Error: PYI053
39 |
   |

PYI053 [*] String and bytes literals longer than 50 characters are not permitted
  --> PYI053.pyi:64:5
   |
63 | @not_warnings_dot_deprecated(
64 |     "Not warnings.deprecated, so this one *should* lead to PYI053 in a stub!"  # Error: PYI053
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
65 | )
66 | def not_a_deprecated_function() -> None: ...
   |
help: Replace with `...`
   |
63 | @not_warnings_dot_deprecated(
   -     "Not warnings.deprecated, so this one *should* lead to PYI053 in a stub!"  # Error: PYI053
64 +     ...  # Error: PYI053
65 | )
   |

PYI053 [*] String and bytes literals longer than 50 characters are not permitted
  --> PYI053.pyi:68:13
   |
66 | def not_a_deprecated_function() -> None: ...
67 |
68 | fbaz: str = f"51 character {foo} stringgggggggggggggggggggggggggg"  # Error: PYI053
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
69 |
70 | from typing import TypeAlias, Literal, Annotated
   |
help: Replace with `...`
   |
67 |
   - fbaz: str = f"51 character {foo} stringgggggggggggggggggggggggggg"  # Error: PYI053
68 + fbaz: str = ...  # Error: PYI053
69 |
   |
