From b8de248ef238c3781f8e4c89679e75e45636c546 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 16:12:02 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/apscheduler/triggers/cron/expressions.py | 4 ++-- src/apscheduler/triggers/cron/fields.py | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/apscheduler/triggers/cron/expressions.py b/src/apscheduler/triggers/cron/expressions.py index ff60f83b..988fd626 100644 --- a/src/apscheduler/triggers/cron/expressions.py +++ b/src/apscheduler/triggers/cron/expressions.py @@ -262,9 +262,9 @@ def __init__(self, last_day): def get_next_value(self, date, field): currval = field.get_value(date) - nextval = monthrange(date.year, date.month)[1]-self.last_day + nextval = monthrange(date.year, date.month)[1] - self.last_day return nextval if currval <= nextval else None def __str__(self): - return f"last-{self.last_day}" \ No newline at end of file + return f"last-{self.last_day}" diff --git a/src/apscheduler/triggers/cron/fields.py b/src/apscheduler/triggers/cron/fields.py index 543955cc..a777fa62 100644 --- a/src/apscheduler/triggers/cron/fields.py +++ b/src/apscheduler/triggers/cron/fields.py @@ -13,8 +13,8 @@ from .expressions import ( WEEKDAYS, AllExpression, - LastNDayOfMonthExpression, LastDayOfMonthExpression, + LastNDayOfMonthExpression, MonthRangeExpression, RangeExpression, WeekdayPositionExpression, @@ -123,7 +123,12 @@ def get_value(self, dateval: datetime) -> int: class DayOfMonthField( - BaseField, extra_compilers=(WeekdayPositionExpression, LastNDayOfMonthExpression, LastDayOfMonthExpression) + BaseField, + extra_compilers=( + WeekdayPositionExpression, + LastNDayOfMonthExpression, + LastDayOfMonthExpression, + ), ): __slots__ = ()