fix(exceptions): replace Any with str | os.PathLike | None for FileSystemError.path #3312

Merged
freemo merged 1 commits from fix/type-safety-filesystem-error-path-hint into master 2026-04-05 21:08:32 +00:00

1 Commits

Author SHA1 Message Date
freemo dd09fadf29 fix(exceptions): replace Any with str | os.PathLike | None for FileSystemError.path
CI / lint (pull_request) Successful in 29s
CI / quality (pull_request) Successful in 35s
CI / typecheck (pull_request) Successful in 57s
CI / security (pull_request) Successful in 55s
CI / build (pull_request) Successful in 17s
CI / helm (pull_request) Successful in 35s
CI / unit_tests (pull_request) Successful in 6m49s
CI / e2e_tests (pull_request) Successful in 18m32s
CI / integration_tests (pull_request) Successful in 23m18s
CI / coverage (pull_request) Successful in 11m1s
CI / docker (pull_request) Successful in 1m35s
CI / status-check (pull_request) Successful in 1s
CI / benchmark-publish (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Successful in 56m58s
Narrow the path parameter type hint in FileSystemError.__init__ from Any to
str | os.PathLike[str] | None. This improves static analysis accuracy since
path is semantically a filesystem path, not an arbitrary value.

Changes:
- Add import os to exceptions.py
- Replace path: Any = None with path: str | os.PathLike[str] | None = None
- Reformat __init__ signature to multi-line for line-length compliance
- Audit call-sites (context_service.py, project_service.py): both pass
  pathlib.Path which implements os.PathLike[str], no changes needed
- Add BDD feature file covering str, pathlib.Path, None, and annotation check
- Add corresponding step definitions

ISSUES CLOSED: #3034
2026-04-05 17:49:20 +00:00