---
source: crates/ruff_linter/src/rules/flake8_annotations/mod.rs
---
ANN201 [*] Missing return type annotation for public function `foo`
  --> suppress_none_returning.py:45:5
   |
44 | # Error
45 | def foo():
   |     ^^^
46 |     return True
   |
help: Add return type annotation: `bool`
   |
44 | # Error
   - def foo():
45 + def foo() -> bool:
46 |     return True
   |
note: This is an unsafe fix and may change runtime behavior

ANN201 [*] Missing return type annotation for public function `foo`
  --> suppress_none_returning.py:50:5
   |
49 | # Error
50 | def foo():
   |     ^^^
51 |     a = 2 + 2
52 |     if a == 4:
   |
help: Add return type annotation: `bool | None`
   |
49 | # Error
   - def foo():
50 + def foo() -> bool | None:
51 |     a = 2 + 2
   |
note: This is an unsafe fix and may change runtime behavior

ANN001 Missing type annotation for function argument `a`
  --> suppress_none_returning.py:59:9
   |
58 | # Error (on the argument, but not the return type)
59 | def foo(a):
   |         ^
60 |     a = 2 + 2
   |
