(
limit_direction: str,
)
| 276 | |
| 277 | |
| 278 | def validate_limit_direction( |
| 279 | limit_direction: str, |
| 280 | ) -> Literal["forward", "backward", "both"]: |
| 281 | valid_limit_directions = ["forward", "backward", "both"] |
| 282 | limit_direction = limit_direction.lower() |
| 283 | if limit_direction not in valid_limit_directions: |
| 284 | raise ValueError( |
| 285 | "Invalid limit_direction: expecting one of " |
| 286 | f"{valid_limit_directions}, got '{limit_direction}'." |
| 287 | ) |
| 288 | # error: Incompatible return value type (got "str", expected |
| 289 | # "Literal['forward', 'backward', 'both']") |
| 290 | return limit_direction # type: ignore[return-value] |
| 291 | |
| 292 | |
| 293 | def validate_limit_area(limit_area: str | None) -> Literal["inside", "outside"] | None: |
no test coverage detected