Refactor codebase following Clean Code principles and add 229 tests
- Extract helpers to reduce function sizes (listing_tasks, app.py, query.py, listing_fetcher) - Replace nonlocal mutations with _PipelineState dataclass in listing_tasks - Fix bugs: isinstance→equality check in repository, verify_exp for OIDC tokens - Consolidate duplicate filter methods in listing_repository - Move hardcoded config to env vars with backward-compatible defaults - Simplify CLI decorator to auto-build QueryParameters - Add deprecation docstring to data_access.py - Test count: 158 → 387 (all passing)
This commit is contained in:
parent
7e05b3c971
commit
150342bb9e
48 changed files with 5029 additions and 990 deletions
|
|
@ -24,15 +24,14 @@ def get_district_names() -> list[str]:
|
|||
return list(_get_districts().keys())
|
||||
|
||||
|
||||
def validate_districts(district_names: list[str]) -> tuple[bool, list[str]]:
|
||||
def validate_districts(district_names: list[str]) -> list[str]:
|
||||
"""Validate that district names exist.
|
||||
|
||||
Args:
|
||||
district_names: List of district names to validate
|
||||
|
||||
Returns:
|
||||
Tuple of (all_valid, invalid_names)
|
||||
List of invalid district names (empty if all valid)
|
||||
"""
|
||||
valid_districts = set(_get_districts().keys())
|
||||
invalid = [d for d in district_names if d not in valid_districts]
|
||||
return len(invalid) == 0, invalid
|
||||
return [d for d in district_names if d not in valid_districts]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue