---
source: crates/ruff_linter/src/rules/ruff/mod.rs
---
RUF100 [*] Unused blanket `noqa` directive
  --> RUF100_0.py:9:12
   |
 8 |     # Invalid
 9 |     c = 1  # noqa
   |            ^^^^^^
10 |     print(c)
   |
help: Remove unused `noqa` directive
   |
8  |     # Invalid
   -     c = 1  # noqa
9  +     c = 1
10 |     print(c)
   |

RUF100 [*] Unused `noqa` directive (unused: `E501`)
  --> RUF100_0.py:13:12
   |
12 |     # Invalid
13 |     d = 1  # noqa: E501
   |            ^^^^^^^^^^^^
14 |
15 |     # Invalid
   |
help: Remove unused `noqa` directive
   |
12 |     # Invalid
   -     d = 1  # noqa: E501
13 +     d = 1
14 |
   |

RUF100 [*] Unused `noqa` directive (unused: `F841`, `E501`)
  --> RUF100_0.py:16:12
   |
15 |     # Invalid
16 |     d = 1  # noqa: F841, E501
   |            ^^^^^^^^^^^^^^^^^^
17 |
18 |     # Invalid (and unimplemented or not enabled)
   |
help: Remove unused `noqa` directive
   |
15 |     # Invalid
   -     d = 1  # noqa: F841, E501
16 +     d = 1
17 |
   |

RUF100 [*] Unused `noqa` directive (unused: `F841`, `W191`; non-enabled: `F821`)
  --> RUF100_0.py:19:12
   |
18 |     # Invalid (and unimplemented or not enabled)
19 |     d = 1  # noqa: F841, W191, F821
   |            ^^^^^^^^^^^^^^^^^^^^^^^^
20 |
21 |     # Invalid (but external)
   |
help: Remove unused `noqa` directive
   |
18 |     # Invalid (and unimplemented or not enabled)
   -     d = 1  # noqa: F841, W191, F821
19 +     d = 1
20 |
   |

RUF100 [*] Unused `noqa` directive (unused: `F841`)
  --> RUF100_0.py:22:12
   |
21 |     # Invalid (but external)
22 |     d = 1  # noqa: F841, V101
   |            ^^^^^^^^^^^^^^^^^^
23 |
24 |     # Invalid (but external)
   |
help: Remove unused `noqa` directive
   |
21 |     # Invalid (but external)
   -     d = 1  # noqa: F841, V101
22 +     d = 1  # noqa: V101
23 |
   |

RUF100 [*] Unused `noqa` directive (unused: `E501`)
  --> RUF100_0.py:29:12
   |
27 |     # fmt: off
28 |     # Invalid - no space before #
29 |     d = 1  # noqa: E501
   |            ^^^^^^^^^^^^
30 |
31 |     # Invalid - many spaces before #
   |
help: Remove unused `noqa` directive
   |
28 |     # Invalid - no space before #
   -     d = 1  # noqa: E501
29 +     d = 1
30 |
   |

F841 [*] Local variable `d` is assigned to but never used
  --> RUF100_0.py:32:5
   |
31 |     # Invalid - many spaces before #
32 |     d = 1  # noqa: E501
   |     ^
33 |     # fmt: on
   |
help: Remove assignment to unused variable `d`
   |
31 |     # Invalid - many spaces before #
   -     d = 1  # noqa: E501
32 |     # fmt: on
   |
note: This is an unsafe fix and may change runtime behavior

RUF100 [*] Unused `noqa` directive (unused: `E501`)
  --> RUF100_0.py:32:12
   |
31 |     # Invalid - many spaces before #
32 |     d = 1  # noqa: E501
   |            ^^^^^^^^^^^^
33 |     # fmt: on
   |
help: Remove unused `noqa` directive
   |
31 |     # Invalid - many spaces before #
   -     d = 1  # noqa: E501
32 +     d = 1
33 |     # fmt: on
   |

RUF100 [*] Unused `noqa` directive (unused: `F841`)
  --> RUF100_0.py:58:6
   |
57 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
58 | """  # noqa: E501, F841
   |      ^^^^^^^^^^^^^^^^^^
59 |
60 | # Invalid
   |
help: Remove unused `noqa` directive
   |
57 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
   - """  # noqa: E501, F841
58 + """  # noqa: E501
59 |
   |

RUF100 [*] Unused `noqa` directive (unused: `E501`)
  --> RUF100_0.py:66:6
   |
65 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.
66 | """  # noqa: E501
   |      ^^^^^^^^^^^^
67 |
68 | # Invalid
   |
help: Remove unused `noqa` directive
   |
65 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.
   - """  # noqa: E501
66 + """
67 |
   |

RUF100 [*] Unused blanket `noqa` directive
  --> RUF100_0.py:74:6
   |
73 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.
74 | """  # noqa
   |      ^^^^^^
75 |
76 | # Valid
   |
help: Remove unused `noqa` directive
   |
73 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.
   - """  # noqa
74 + """
75 |
   |

F401 [*] `shelve` imported but unused
  --> RUF100_0.py:88:8
   |
86 | import collections  # noqa
87 | import os  # noqa: F401, RUF100
88 | import shelve  # noqa: RUF100
   |        ^^^^^^
89 | import sys  # noqa: F401, RUF100
   |
help: Remove unused import: `shelve`
   |
87 | import os  # noqa: F401, RUF100
   - import shelve  # noqa: RUF100
88 | import sys  # noqa: F401, RUF100
   |

E501 Line too long (89 > 88)
  --> RUF100_0.py:93:89
   |
91 | print(sys.path)
92 |
93 | "shape:  (6,)\nSeries: '' [duration[μs]]\n[\n\t0µs\n\t1µs\n\t2µs\n\t3µs\n\t4µs\n\t5µs\n]"  # noqa: F401
   |                                                                                         ^
   |

RUF100 [*] Unused `noqa` directive (unused: `F401`)
  --> RUF100_0.py:93:92
   |
91 | print(sys.path)
92 |
93 | "shape:  (6,)\nSeries: '' [duration[μs]]\n[\n\t0µs\n\t1µs\n\t2µs\n\t3µs\n\t4µs\n\t5µs\n]"  # noqa: F401
   |                                                                                            ^^^^^^^^^^^^
   |
help: Remove unused `noqa` directive
   |
92 |
   - "shape:  (6,)\nSeries: '' [duration[μs]]\n[\n\t0µs\n\t1µs\n\t2µs\n\t3µs\n\t4µs\n\t5µs\n]"  # noqa: F401
93 + "shape:  (6,)\nSeries: '' [duration[μs]]\n[\n\t0µs\n\t1µs\n\t2µs\n\t3µs\n\t4µs\n\t5µs\n]"
94 |
   |

F841 [*] Local variable `e` is assigned to but never used
   --> RUF100_0.py:108:5
    |
106 |     # Invalid - nonexistent error code with multibyte character
107 |     d = 1  # noqa: F841, E50
108 |     e = 1  # noqa: E50
    |     ^
    |
help: Remove assignment to unused variable `e`
    |
107 |     d = 1  # noqa: F841, E50
    -     e = 1  # noqa: E50
108 |
    |
note: This is an unsafe fix and may change runtime behavior

RUF100 [*] Unused `noqa` directive (duplicated: `F841`)
   --> RUF100_0.py:118:12
    |
116 | # Check duplicate code detection
117 | def f():
118 |     x = 2  # noqa: F841, F841, X200
    |            ^^^^^^^^^^^^^^^^^^^^^^^^
119 |
120 |     y = 2 == bar  # noqa: SIM300, F841, SIM300, SIM300
    |
help: Remove unused `noqa` directive
    |
117 | def f():
    -     x = 2  # noqa: F841, F841, X200
118 +     x = 2  # noqa: F841
119 |
    |

RUF100 [*] Unused `noqa` directive (duplicated: `SIM300`, `SIM300`)
   --> RUF100_0.py:120:19
    |
118 |     x = 2  # noqa: F841, F841, X200
119 |
120 |     y = 2 == bar  # noqa: SIM300, F841, SIM300, SIM300
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
121 |
122 |     z = 2  # noqa: F841 F841  F841, F841, F841
    |
help: Remove unused `noqa` directive
    |
119 |
    -     y = 2 == bar  # noqa: SIM300, F841, SIM300, SIM300
120 +     y = 2 == bar  # noqa: SIM300, F841
121 |
    |

RUF100 [*] Unused `noqa` directive (duplicated: `F841`, `F841`, `F841`, `F841`)
   --> RUF100_0.py:122:12
    |
120 |     y = 2 == bar  # noqa: SIM300, F841, SIM300, SIM300
121 |
122 |     z = 2  # noqa: F841 F841  F841, F841, F841
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
123 |
124 |     return
    |
help: Remove unused `noqa` directive
    |
121 |
    -     z = 2  # noqa: F841 F841  F841, F841, F841
122 +     z = 2  # noqa: F841
123 |
    |

RUF100 [*] Unused `noqa` directive (duplicated: `S307`, `S307`, `S307`)
   --> RUF100_0.py:129:20
    |
127 | # Allow code redirects
128 | x = eval(command)  # noqa: PGH001, S307
129 | x = eval(command)  # noqa: S307, PGH001, S307, S307, S307
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
130 | x = eval(command)  # noqa: PGH001, S307, PGH001
131 | x = eval(command)  # noqa: PGH001, S307, PGH001, S307
    |
help: Remove unused `noqa` directive
    |
128 | x = eval(command)  # noqa: PGH001, S307
    - x = eval(command)  # noqa: S307, PGH001, S307, S307, S307
129 + x = eval(command)  # noqa: S307, PGH001
130 | x = eval(command)  # noqa: PGH001, S307, PGH001
    |

RUF100 [*] Unused `noqa` directive (duplicated: `PGH001`)
   --> RUF100_0.py:130:20
    |
128 | x = eval(command)  # noqa: PGH001, S307
129 | x = eval(command)  # noqa: S307, PGH001, S307, S307, S307
130 | x = eval(command)  # noqa: PGH001, S307, PGH001
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
131 | x = eval(command)  # noqa: PGH001, S307, PGH001, S307
    |
help: Remove unused `noqa` directive
    |
129 | x = eval(command)  # noqa: S307, PGH001, S307, S307, S307
    - x = eval(command)  # noqa: PGH001, S307, PGH001
130 + x = eval(command)  # noqa: PGH001, S307
131 | x = eval(command)  # noqa: PGH001, S307, PGH001, S307
    |

RUF100 [*] Unused `noqa` directive (duplicated: `PGH001`, `S307`)
   --> RUF100_0.py:131:20
    |
129 | x = eval(command)  # noqa: S307, PGH001, S307, S307, S307
130 | x = eval(command)  # noqa: PGH001, S307, PGH001
131 | x = eval(command)  # noqa: PGH001, S307, PGH001, S307
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
help: Remove unused `noqa` directive
    |
130 | x = eval(command)  # noqa: PGH001, S307, PGH001
    - x = eval(command)  # noqa: PGH001, S307, PGH001, S307
131 + x = eval(command)  # noqa: PGH001, S307
    |
