---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
no_self_use.py:7:9: PLR6301 Method `developer_greeting` could be a function, class method, or static method
  |
6 | class Person:
7 |     def developer_greeting(self, name):  # [no-self-use]
  |         ^^^^^^^^^^^^^^^^^^ PLR6301
8 |         print(f"Greetings {name}!")
  |

no_self_use.py:10:9: PLR6301 Method `greeting_1` could be a function, class method, or static method
   |
 8 |         print(f"Greetings {name}!")
 9 |
10 |     def greeting_1(self):  # [no-self-use]
   |         ^^^^^^^^^^ PLR6301
11 |         print("Hello!")
   |

no_self_use.py:13:9: PLR6301 Method `greeting_2` could be a function, class method, or static method
   |
11 |         print("Hello!")
12 |
13 |     def greeting_2(self):  # [no-self-use]
   |         ^^^^^^^^^^ PLR6301
14 |         print("Hi!")
   |

no_self_use.py:103:9: PLR6301 Method `validate_y` could be a function, class method, or static method
    |
102 |     @y.validator
103 |     def validate_y(self, attribute, value):
    |         ^^^^^^^^^^ PLR6301
104 |         if value <= 0:
105 |             raise ValueError("y must be a positive integer")
    |

no_self_use.py:128:9: PLR6301 Method `non_simple_assignment` could be a function, class method, or static method
    |
126 |     # Errors
127 |
128 |     def non_simple_assignment(self):
    |         ^^^^^^^^^^^^^^^^^^^^^ PLR6301
129 |         msg = foo = ""
130 |         raise NotImplementedError(msg)
    |

no_self_use.py:132:9: PLR6301 Method `non_simple_assignment_2` could be a function, class method, or static method
    |
130 |         raise NotImplementedError(msg)
131 |
132 |     def non_simple_assignment_2(self):
    |         ^^^^^^^^^^^^^^^^^^^^^^^ PLR6301
133 |         msg[0] = ""
134 |         raise NotImplementedError(msg)
    |

no_self_use.py:136:9: PLR6301 Method `unused_message` could be a function, class method, or static method
    |
134 |         raise NotImplementedError(msg)
135 |
136 |     def unused_message(self):
    |         ^^^^^^^^^^^^^^ PLR6301
137 |         msg = ""
138 |         raise NotImplementedError("")
    |

no_self_use.py:140:9: PLR6301 Method `unused_message_2` could be a function, class method, or static method
    |
138 |         raise NotImplementedError("")
139 |
140 |     def unused_message_2(self, x):
    |         ^^^^^^^^^^^^^^^^ PLR6301
141 |         msg = ""
142 |         raise NotImplementedError(x)
    |

no_self_use.py:145:9: PLR6301 Method `developer_greeting` could be a function, class method, or static method
    |
144 | class TPerson:
145 |     def developer_greeting(self, name):  # [no-self-use]
    |         ^^^^^^^^^^^^^^^^^^ PLR6301
146 |         print(t"Greetings {name}!")
    |

no_self_use.py:151:9: PLR6301 Method `tstring` could be a function, class method, or static method
    |
149 |         print(t"Hello from {self.name} !")
150 |
151 |     def tstring(self, x):
    |         ^^^^^^^ PLR6301
152 |         msg = t"{x}"
153 |         raise NotImplementedError(msg)
    |
