---
source: crates/ruff_linter/src/rules/flake8_annotations/mod.rs
---
ANN201 [*] Missing return type annotation for public function `foo`
 --> shadowed_builtins.py:4:5
  |
2 | from typing import override
3 |
4 | def foo():
  |     ^^^
5 |     return "!"
  |
help: Add return type annotation: `builtins.str`
  |
2 | from typing import override
3 + import builtins
4 |
  - def foo():
5 + def foo() -> builtins.str:
6 |     return "!"
  |
note: This is an unsafe fix and may change runtime behavior

ANN202 [*] Missing return type annotation for private function `_foo`
 --> shadowed_builtins.py:7:5
  |
5 |     return "!"
6 |
7 | def _foo():
  |     ^^^^
8 |     return "!"
  |
help: Add return type annotation: `builtins.str`
  |
2 | from typing import override
3 + import builtins
4 |
5 | def foo():
6 |     return "!"
7 |
  - def _foo():
8 + def _foo() -> builtins.str:
9 |     return "!"
  |
note: This is an unsafe fix and may change runtime behavior

ANN204 [*] Missing return type annotation for special method `__str__`
  --> shadowed_builtins.py:12:9
   |
10 | class C:
11 |     @override
12 |     def __str__(self):
   |         ^^^^^^^
13 |         return "!"
   |
help: Add return type annotation: `str`
   |
2  | from typing import override
3  + import builtins
4  |
--------------------------------------------------------------------------------
12 |     @override
   -     def __str__(self):
13 +     def __str__(self) -> builtins.str:
14 |         return "!"
   |
note: This is an unsafe fix and may change runtime behavior

ANN205 [*] Missing return type annotation for staticmethod `foo`
  --> shadowed_builtins.py:16:9
   |
15 |     @staticmethod
16 |     def foo():
   |         ^^^
17 |         return "!"
   |
help: Add return type annotation: `builtins.str`
   |
2  | from typing import override
3  + import builtins
4  |
--------------------------------------------------------------------------------
16 |     @staticmethod
   -     def foo():
17 +     def foo() -> builtins.str:
18 |         return "!"
   |
note: This is an unsafe fix and may change runtime behavior

ANN206 [*] Missing return type annotation for classmethod `bar`
  --> shadowed_builtins.py:20:9
   |
19 |     @classmethod
20 |     def bar(cls):
   |         ^^^
21 |         return "!"
   |
help: Add return type annotation: `builtins.str`
   |
2  | from typing import override
3  + import builtins
4  |
--------------------------------------------------------------------------------
20 |     @classmethod
   -     def bar(cls):
21 +     def bar(cls) -> builtins.str:
22 |         return "!"
   |
note: This is an unsafe fix and may change runtime behavior
