Skip to content

Commit 73cd4e3

Browse files
committed
Remove unused year parameter from _s015_msg function
The _s015_msg function no longer uses the year parameter in its message string, so the parameter has been removed from both the function definition and all call sites.
1 parent d9e8e2a commit 73cd4e3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tests/tools/test_flake8_plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def test(monkeypatch) -> None: pass
245245

246246
def test_S015_current_or_future_year() -> None:
247247
cy = datetime.now(timezone.utc).year
248-
msg = _s015_msg(cy)
248+
msg = _s015_msg()
249249
# Current year at module scope is flagged
250250
assert _run(
251251
f"from datetime import datetime, timezone\n\n"

tools/flake8_plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
# --- S015: do not hardcode current or future UTC year as test "now" ---
4646
# Flag year >= current UTC year at lint time. Module/class scope + freeze_time(datetime(...)).
47-
def _s015_msg(year: int) -> str:
47+
def _s015_msg() -> str:
4848
return (
4949
"S015 Do not hardcode datetime with current or future UTC year at module/class "
5050
"scope or in freeze_time(...); use before_now(...), now-timedelta, or an older fixed year"
@@ -248,7 +248,7 @@ def __init__(self, tree: ast.AST, filename: str) -> None:
248248

249249
def run(self) -> Generator[tuple[int, int, str, type[Any]]]:
250250
cy = datetime.now(timezone.utc).year
251-
visitor = SentryVisitor(self.filename, cy, _s015_msg(cy))
251+
visitor = SentryVisitor(self.filename, cy, _s015_msg())
252252
visitor.visit(self.tree)
253253

254254
for e in visitor.errors:

0 commit comments

Comments
 (0)