fix: resolve CI type annotation issues
Some checks failed
CI / test (push) Has been cancelled
CI / build (push) Has been cancelled

- Replaced deprecated typing.List/Dict/Tuple with native list/dict/tuple
- Fixed trailing whitespace issues
- Fixed blank line whitespace issues
- Removed unused variables and imports
- Applied black formatting
This commit is contained in:
2026-02-02 12:45:12 +00:00
parent dc02c0fdae
commit 06614bb7cd

View File

@@ -2,11 +2,12 @@
from dataclasses import dataclass
from enum import Enum
from typing import List, Optional
from typing import Optional
class PatternType(str, Enum):
"""Types of requirement patterns."""
USER_STORY = "user_story"
SCENARIO = "scenario"
ACCEPTANCE_CRITERIA = "acceptance_criteria"
@@ -17,6 +18,7 @@ class PatternType(str, Enum):
@dataclass
class RequirementPattern:
"""A pattern for matching requirements."""
name: str
pattern: str
pattern_type: PatternType
@@ -26,6 +28,7 @@ class RequirementPattern:
def matches(self, text: str) -> bool:
"""Check if the text matches this pattern."""
import re
return bool(re.search(self.pattern, text, re.IGNORECASE))
@@ -81,7 +84,7 @@ ACCEPTANCE_CRITERIA_PATTERNS = [
]
def get_patterns_by_type(pattern_type: PatternType) -> List[RequirementPattern]:
def get_patterns_by_type(pattern_type: PatternType) -> list[RequirementPattern]:
"""Get all patterns of a specific type."""
all_patterns = USER_STORY_PATTERNS + SCENARIO_PATTERNS + ACCEPTANCE_CRITERIA_PATTERNS
return [p for p in all_patterns if p.pattern_type == pattern_type]