fix: resolve all basedpyright warnings

- Use collections.abc.Generator/Iterable instead of deprecated typing imports
- Replace Optional with union syntax (X | None)
- Add explicit type annotations to eliminate reportUnknownVariableType
- Use typing.cast for untyped mistletoe attributes (content, level, line_number)
- Replace mutable default arguments with None defaults (reportCallInDefaultInitializer)
- Add ClassVar annotation for model_config (reportIncompatibleVariableOverride)
- Add @override decorator for settings_customise_sources (reportImplicitOverride)
- Annotate class attributes in Tag (reportUnannotatedClassAttribute)
- Add parameter type annotations in test (reportMissingParameterType)
- Assign unused call result to _ (reportUnusedCallResult)
This commit is contained in:
Konstantin Fickel 2026-02-15 17:10:09 +01:00
parent 1e203d9db3
commit 49cd9bcfa0
Signed by: kfickel
GPG key ID: A793722F9933C1A5
10 changed files with 770 additions and 16 deletions

View file

@ -4,13 +4,13 @@ from datetime import datetime, time
import pytest
from streamer.localize.localized_shard import LocalizedShard
from streamer.timesheet.configuration import (
from streamd.localize.localized_shard import LocalizedShard
from streamd.timesheet.configuration import (
TIMESHEET_DIMENSION_NAME,
TimesheetPointType,
)
from streamer.timesheet.extract import extract_timesheets
from streamer.timesheet.timecard import SpecialDayType, Timecard, Timesheet
from streamd.timesheet.extract import extract_timesheets
from streamd.timesheet.timecard import SpecialDayType, Timecard, Timesheet
def point(at: datetime, type: TimesheetPointType) -> LocalizedShard:
@ -243,7 +243,7 @@ class TestExtractTimesheets:
]
with pytest.raises(ValueError, match=r"Last Timecard of .* is not a break"):
extract_timesheets(shards)
_ = extract_timesheets(shards)
def test_two_special_day_types_same_day_is_invalid(self):
"""
@ -257,7 +257,7 @@ class TestExtractTimesheets:
]
with pytest.raises(ValueError, match=r"is both .* and .*"):
extract_timesheets(shards)
_ = extract_timesheets(shards)
def test_points_with_mixed_dates_inside_one_group_raises(self):
"""
@ -273,7 +273,7 @@ class TestExtractTimesheets:
]
with pytest.raises(ValueError, match=r"Last Timecard of .* is not a break"):
extract_timesheets(shards)
_ = extract_timesheets(shards)
def test_day_with_only_breaks_is_ignored(self):
"""