Skip to content

Commit

Permalink
revert line length format to 99
Browse files Browse the repository at this point in the history
  • Loading branch information
PPsyrius committed Jan 30, 2024
1 parent 4800781 commit cfade33
Show file tree
Hide file tree
Showing 66 changed files with 176 additions and 608 deletions.
6 changes: 1 addition & 5 deletions holidays/countries/albania.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@


class Albania(
ObservedHolidayBase,
ChristianHolidays,
InternationalHolidays,
IslamicHolidays,
StaticHolidays,
ObservedHolidayBase, ChristianHolidays, InternationalHolidays, IslamicHolidays, StaticHolidays
):
"""
References:
Expand Down
3 changes: 1 addition & 2 deletions holidays/countries/belize.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ def _populate_public_holidays(self):
# Indigenous Peoples' Resistance Day / Pan American Day.
name = "Indigenous Peoples' Resistance Day" if self._year >= 2021 else "Pan American Day"
self._move_holiday(
self._add_columbus_day(name),
rule=TUE_WED_THU_TO_PREV_MON + FRI_SUN_TO_NEXT_MON,
self._add_columbus_day(name), rule=TUE_WED_THU_TO_PREV_MON + FRI_SUN_TO_NEXT_MON
)

# Garifuna Settlement Day.
Expand Down
3 changes: 1 addition & 2 deletions holidays/countries/bulgaria.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,7 @@ def _populate_public_holidays(self):

if self.observed:
self._populate_observed(
dts_observed,
excluded_names={self.tr("Велика събота"), self.tr("Великден")},
dts_observed, excluded_names={self.tr("Велика събота"), self.tr("Великден")}
)

def _populate_school_holidays(self):
Expand Down
3 changes: 1 addition & 2 deletions holidays/countries/cambodia.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ def _populate_public_holidays(self):

if self._year >= 1994:
self._add_holiday_jun_18(
# Birthday of Her Majesty the Queen-Mother
# NORODOM MONINEATH SIHANOUK of Cambodia
# Birthday of Her Majesty the Queen-Mother NORODOM MONINEATH SIHANOUK of Cambodia
tr("ព្រះរាជពិធីបុណ្យចម្រើនព្រះជន្ម សម្តេចព្រះមហាក្សត្រី ព្រះវររាជមាតា នរោត្តម មុនិនាថ សីហនុ"),
)

Expand Down
6 changes: 1 addition & 5 deletions holidays/countries/cameroon.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@


class Cameroon(
ObservedHolidayBase,
ChristianHolidays,
InternationalHolidays,
IslamicHolidays,
StaticHolidays,
ObservedHolidayBase, ChristianHolidays, InternationalHolidays, IslamicHolidays, StaticHolidays
):
"""
References:
Expand Down
6 changes: 1 addition & 5 deletions holidays/countries/chad.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@


class Chad(
ObservedHolidayBase,
ChristianHolidays,
InternationalHolidays,
IslamicHolidays,
StaticHolidays,
ObservedHolidayBase, ChristianHolidays, InternationalHolidays, IslamicHolidays, StaticHolidays
):
"""
References:
Expand Down
12 changes: 2 additions & 10 deletions holidays/countries/china.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,15 +441,7 @@ class ChinaStaticHolidays:
2012: (JUN, 22, dragon_boat_festival), # observed from Jun 23
2015: (OCT, 6, mid_autumn_festival), # observed from Sep 27
2020: (
(
JAN,
30,
chinese_new_year,
), # Spring Festival (extended due to Covid-19 decree)
(
OCT,
6,
mid_autumn_festival,
), # observed from Oct 1, overlap with National Day
(JAN, 30, chinese_new_year), # Spring Festival (extended due to Covid-19 decree)
(OCT, 6, mid_autumn_festival), # observed from Oct 1, overlap with National Day
),
}
3 changes: 1 addition & 2 deletions holidays/countries/hongkong.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,7 @@ def _populate_public_holidays(self):
self._add_mid_autumn_festival(name)
else:
self._add_holiday(
f"The second day of the {name} (Monday)",
mid_autumn_date + td(days=+2),
f"The second day of the {name} (Monday)", mid_autumn_date + td(days=+2)
)
else:
self._add_mid_autumn_festival_day_two(f"The day following the {name}")
Expand Down
3 changes: 1 addition & 2 deletions holidays/countries/ireland.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ def _populate_public_holidays(self):

# St. Stephen's Day.
self._add_observed(
self._add_christmas_day_two("St. Stephen's Day"),
rule=SAT_SUN_TO_NEXT_MON_TUE,
self._add_christmas_day_two("St. Stephen's Day"), rule=SAT_SUN_TO_NEXT_MON_TUE
)


Expand Down
13 changes: 1 addition & 12 deletions holidays/countries/malaysia.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,18 +227,7 @@ def _populate_public_holidays(self):
dts_observed.update(self._add_ramadan_beginning_day("Beginning of Ramadan"))

# Nuzul Al-Quran Day.
if self.subdiv in {
"KTN",
"KUL",
"LBN",
"PHG",
"PJY",
"PLS",
"PNG",
"PRK",
"SGR",
"TRG",
}:
if self.subdiv in {"KTN", "KUL", "LBN", "PHG", "PJY", "PLS", "PNG", "PRK", "SGR", "TRG"}:
dts_observed.update(self._add_nuzul_al_quran_day("Nuzul Al-Quran Day"))

# Thaipusam.
Expand Down
3 changes: 1 addition & 2 deletions holidays/countries/marshall_islands.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ def __init__(self, *args, **kwargs):
def _populate_public_holidays(self):
if self._year <= 2019:
warnings.warn(
"Years before 2020 are not available for the Marshall Islands (MH).",
Warning,
"Years before 2020 are not available for the Marshall Islands (MH).", Warning
)

# New Year's Day
Expand Down
3 changes: 1 addition & 2 deletions holidays/countries/new_zealand.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ def _populate_public_holidays(self):
# New Year's Day
self._add_observed(self._add_new_years_day("New Year's Day"), rule=SAT_SUN_TO_NEXT_MON_TUE)
self._add_observed(
self._add_new_years_day_two("Day after New Year's Day"),
rule=SAT_SUN_TO_NEXT_MON_TUE,
self._add_new_years_day_two("Day after New Year's Day"), rule=SAT_SUN_TO_NEXT_MON_TUE
)

# Waitangi Day
Expand Down
6 changes: 1 addition & 5 deletions holidays/countries/nigeria.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@


class Nigeria(
ObservedHolidayBase,
ChristianHolidays,
InternationalHolidays,
IslamicHolidays,
StaticHolidays,
ObservedHolidayBase, ChristianHolidays, InternationalHolidays, IslamicHolidays, StaticHolidays
):
"""
https://en.wikipedia.org/wiki/Public_holidays_in_Nigeria
Expand Down
6 changes: 1 addition & 5 deletions holidays/countries/philippines.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@


class Philippines(
HolidayBase,
ChineseCalendarHolidays,
ChristianHolidays,
InternationalHolidays,
IslamicHolidays,
HolidayBase, ChineseCalendarHolidays, ChristianHolidays, InternationalHolidays, IslamicHolidays
):
"""
Philippines holidays.
Expand Down
3 changes: 1 addition & 2 deletions holidays/countries/south_korea.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ def _populate_observed(self, dts: Set[date], three_day_holidays: Dict[date, str]
if not self._is_observed(dt):
continue
dt_observed = self._get_observed_date(
dt,
SUN_TO_NEXT_WORKDAY if dt in three_day_holidays else SAT_SUN_TO_NEXT_WORKDAY,
dt, SUN_TO_NEXT_WORKDAY if dt in three_day_holidays else SAT_SUN_TO_NEXT_WORKDAY
)
if dt_observed != dt or len(self.get_list(dt)) > 1:
if dt_observed == dt:
Expand Down
6 changes: 1 addition & 5 deletions holidays/countries/spain.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@


class Spain(
ObservedHolidayBase,
ChristianHolidays,
InternationalHolidays,
IslamicHolidays,
StaticHolidays,
ObservedHolidayBase, ChristianHolidays, InternationalHolidays, IslamicHolidays, StaticHolidays
):
"""
Holidays checked with official sources for 2010-2023 only.
Expand Down
6 changes: 1 addition & 5 deletions holidays/countries/tanzania.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@


class Tanzania(
HolidayBase,
ChristianHolidays,
InternationalHolidays,
IslamicHolidays,
StaticHolidays,
HolidayBase, ChristianHolidays, InternationalHolidays, IslamicHolidays, StaticHolidays
):
"""
References:
Expand Down
6 changes: 1 addition & 5 deletions holidays/countries/timor_leste.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@


class TimorLeste(
HolidayBase,
ChristianHolidays,
InternationalHolidays,
IslamicHolidays,
StaticHolidays,
HolidayBase, ChristianHolidays, InternationalHolidays, IslamicHolidays, StaticHolidays
):
"""
References:
Expand Down
14 changes: 2 additions & 12 deletions holidays/countries/united_states.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,22 +164,12 @@ def _add_christmas_eve_holiday(self):
# If on Saturday or Sunday, observed on Friday
name = "Christmas Eve"
self._add_observed(
self._add_christmas_eve(name),
name=name,
rule=FRI_TO_PREV_THU + SAT_SUN_TO_PREV_FRI,
self._add_christmas_eve(name), name=name, rule=FRI_TO_PREV_THU + SAT_SUN_TO_PREV_FRI
)

def _populate_subdiv_holidays(self):
# Martin Luther King Jr. Day
if self._year >= 1986 and self.subdiv not in {
"AL",
"AR",
"AZ",
"GA",
"ID",
"MS",
"NH",
}:
if self._year >= 1986 and self.subdiv not in {"AL", "AR", "AZ", "GA", "ID", "MS", "NH"}:
self._add_holiday_3rd_mon_of_jan("Martin Luther King Jr. Day")

# Washington's Birthday
Expand Down
3 changes: 1 addition & 2 deletions holidays/countries/vanuatu.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ def _populate_public_holidays(self):

# Family Day.
self._add_observed(
self._add_christmas_day_two("Family Day"),
rule=SUN_TO_NEXT_MON + MON_TO_NEXT_TUE,
self._add_christmas_day_two("Family Day"), rule=SUN_TO_NEXT_MON + MON_TO_NEXT_TUE
)


Expand Down
6 changes: 1 addition & 5 deletions holidays/countries/zambia.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,7 @@ class ZambiaStaticHolidays:
special_public_holidays = {
2016: (
(AUG, 11, "General elections and referendum"),
(
SEP,
13,
"Inauguration ceremony of President-elect and Vice President-elect",
),
(SEP, 13, "Inauguration ceremony of President-elect and Vice President-elect"),
),
2018: (
(MAR, 9, "Public holiday"),
Expand Down
6 changes: 1 addition & 5 deletions holidays/groups/christian.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,7 @@ def __verify_calendar(calendar):
"""
Verify calendar type.
"""
if calendar not in {
GREGORIAN_CALENDAR,
JULIAN_CALENDAR,
JULIAN_REVISED_CALENDAR,
}:
if calendar not in {GREGORIAN_CALENDAR, JULIAN_CALENDAR, JULIAN_REVISED_CALENDAR}:
raise ValueError(
f"Unknown calendar name: {calendar}. "
f"Use `{GREGORIAN_CALENDAR}`, `{JULIAN_CALENDAR}` or `{JULIAN_REVISED_CALENDAR}`."
Expand Down
7 changes: 2 additions & 5 deletions holidays/holiday_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,7 @@ def __getattr__(self, name):
# Handle <nth> <weekday> <before/from> <month> <day> patterns (e.g.,
# _add_holiday_1st_mon_before_jun_15() or _add_holiday_1st_mon_from_jun_15()).
nth_weekday_from = re.match(
r"_add_holiday_(\d{1,2})\w{2}_(\w+)_(before|from)_(\w{3})_(\d{1,2})",
name,
r"_add_holiday_(\d{1,2})\w{2}_(\w+)_(before|from)_(\w{3})_(\d{1,2})", name
)
if nth_weekday_from:
number, weekday, date_direction, month, day = nth_weekday_from.groups()
Expand Down Expand Up @@ -709,9 +708,7 @@ def _add_special_holidays(self, mapping_names, observed=False):
self._add_holiday(
self.tr(self.substituted_label)
% date(
optional[0] if optional else self._year,
from_month,
from_day,
optional[0] if optional else self._year, from_month, from_day
).strftime(self.tr(self.substituted_date_format)),
to_month,
to_day,
Expand Down
5 changes: 1 addition & 4 deletions holidays/observed_holiday_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,7 @@ def _get_observed_date(self, dt: date, rule: ObservedRule) -> date:
return dt

def _add_observed(
self,
dt: DateArg,
name: Optional[str] = None,
rule: Optional[ObservedRule] = None,
self, dt: DateArg, name: Optional[str] = None, rule: Optional[ObservedRule] = None
) -> Tuple[bool, date]:
dt = dt if isinstance(dt, date) else date(self._year, *dt)

Expand Down
7 changes: 1 addition & 6 deletions holidays/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,7 @@
"UMI",
"HolidaysUM",
),
"united_states_virgin_islands": (
"UnitedStatesVirginIslands",
"VI",
"VIR",
"HolidaysVI",
),
"united_states_virgin_islands": ("UnitedStatesVirginIslands", "VI", "VIR", "HolidaysVI"),
"united_states": ("UnitedStates", "US", "USA"),
"uruguay": ("Uruguay", "UY", "URY"),
"uzbekistan": ("Uzbekistan", "UZ", "UZB"),
Expand Down
3 changes: 1 addition & 2 deletions holidays/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,7 @@ def CountryHoliday(
"""

warnings.warn(
"CountryHoliday is deprecated, use country_holidays instead.",
DeprecationWarning,
"CountryHoliday is deprecated, use country_holidays instead.", DeprecationWarning
)
return country_holidays(country, subdiv, years, expand, observed, prov, state)

Expand Down
Loading

0 comments on commit cfade33

Please sign in to comment.