High Python

Use type hints everywhere

Rule Description

Add type hints to all function signatures and class attributes:
- Enables static analysis with mypy/pyright
- Improves IDE autocompletion
- Documents expected types
- Catches type errors before runtime

```python
from typing import Optional

def process_user(user_id: int, name: str | None = None) -> dict[str, Any]:
...

class UserService:
def __init__(self, repo: UserRepository) -> None:
self.repo = repo
```

Included in Rulesets

Django Best Practices
36 rules • 1 standard
View
FastAPI Guidelines
36 rules • 1 standard
View
Python Standards
33 rules • 2 standards
View
Code Review Standards
58 rules • 0 standards
View

Add This Rule

Sign in to add this rule to your workspace

Sign in with GitHub

Details

Severity
High
Category
Python
Used in
4 rulesets