Why this matters
Type annotations improve code clarity, making it easier to understand function inputs and outputs. They also help catch type-related errors early, reducing debugging time.
Check if function signatures include type annotations. Type hints improve readability and help catch type-related errors early. Recommend adding type annotations where missing.
Type annotations improve code clarity, making it easier to understand function inputs and outputs. They also help catch type-related errors early, reducing debugging time.
Side-by-side examples engineers can pattern-match during review.
def add(a, b):
return a + bdef add(a: int, b: int) -> int:
return a + bdef add(a, b):
return a + bdef add(a: int, b: int) -> int:
return a + bFrom the same buckets as this rule.