Skip to content

Commit d671910

Browse files
CrispStrobeclaude
andcommitted
fix(ci): clear pre-existing mypy errors
The CI lane has been red across the last several commits with 5 mypy errors that are unrelated to any of the recent feature work — fix them all so the pipeline goes back to green. Two cross-platform-tolerant patterns: 1. `# type: ignore[code, unused-ignore]` The `unused-ignore` code suppresses mypy's own "Unused type: ignore" meta-warning, which lets the same comment work on both Linux (where the underlying error fires and the ignore is needed) and macOS (where the symbol resolves correctly and the ignore would otherwise be flagged unused). 2. Apply the pattern to: - webdav_provider.py:431, 483 — st_birthtime is macOS-only; runtime code already handles the AttributeError, just needed [attr-defined, unused-ignore] to satisfy mypy on Linux. - webdav_server.py:25, 29 — waitress and cheroot have no library stubs in CI; needed [import-untyped, no-redef, unused-ignore]. - cli.py:63 — same waitress story; [import-untyped, unused-ignore]. Verified: $ mypy --no-incremental cli.py services Success: no issues found in 8 source files No behaviour change. No new tests (the CI already runs pytest, this just unsticks mypy so the rest of the lane can be observed). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 845ed2d commit d671910

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
try:
6161
# Check for at least one server, matching webdav_server.py
6262
try:
63-
import waitress # type: ignore[import-untyped] # noqa: F401 - dependency probe
63+
import waitress # type: ignore[import-untyped, unused-ignore] # noqa: F401 - dependency probe
6464
except ImportError:
6565
import cheroot # noqa: F401 - dependency probe
6666
except ImportError:

services/webdav_provider.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,10 @@ def end_write(self, with_errors: bool):
428428
modification_time = mtime.isoformat()
429429

430430
try:
431-
ctime = datetime.fromtimestamp(stat_info.st_birthtime, tz=timezone.utc)
431+
# st_birthtime is macOS/BSD-only; the AttributeError
432+
# branch covers Linux. mypy's stat_result stub
433+
# doesn't expose it, so silence it here.
434+
ctime = datetime.fromtimestamp(stat_info.st_birthtime, tz=timezone.utc) # type: ignore[attr-defined, unused-ignore]
432435
creation_time = ctime.isoformat()
433436
except AttributeError:
434437
ctime = datetime.fromtimestamp(stat_info.st_ctime, tz=timezone.utc)
@@ -480,7 +483,8 @@ def end_write(self, with_errors: bool):
480483
modification_time = mtime.isoformat()
481484

482485
try:
483-
ctime = datetime.fromtimestamp(stat_info.st_birthtime, tz=timezone.utc)
486+
# st_birthtime is macOS/BSD-only; AttributeError covers Linux.
487+
ctime = datetime.fromtimestamp(stat_info.st_birthtime, tz=timezone.utc) # type: ignore[attr-defined, unused-ignore]
484488
creation_time = ctime.isoformat()
485489
except AttributeError:
486490
ctime = datetime.fromtimestamp(stat_info.st_ctime, tz=timezone.utc)

services/webdav_server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
serve: Any = None
2323
wsgi: Any = None
2424
try:
25-
from waitress import serve # type: ignore[import-untyped, no-redef] # noqa: F811
25+
from waitress import serve # type: ignore[import-untyped, no-redef, unused-ignore] # noqa: F811
2626
WSGI_SERVER = 'waitress'
2727
except ImportError:
2828
try:
29-
from cheroot import wsgi # noqa: F811
29+
from cheroot import wsgi # type: ignore[import-untyped, no-redef, unused-ignore] # noqa: F811
3030
WSGI_SERVER = 'cheroot'
3131
except ImportError:
3232
print("❌ No suitable WSGI server found. Install one of:")

0 commit comments

Comments
 (0)