+
Skip to content

Conversation

PPsyrius
Copy link
Collaborator

@PPsyrius PPsyrius commented Mar 13, 2025

Proposed change

  • Add support for the GOVERNMENT, OPTIONAL, SCHOOL, and WORKDAY categories.
  • Clean up zh_TW l10n to match actual sources.
  • Change start_date from 1912 to 1998 as per our earliest available online document: Ministry of Interior (87) Order No. 8706459.
  • Refactor existing test cases to current library-wide standard, Add 1998-2009 year-specific test cases based on DGPA Work Calendar sources [1] [2].

Resolves #1912 .

Type of change

  • New country/market holidays support (thank you!)
  • Supported country/market holidays update (calendar discrepancy fix, localization)
  • Existing code/documentation/test/process quality improvement (best practice, cleanup, refactoring, optimization)
  • Dependency update (version deprecation/pin/upgrade)
  • Bugfix (non-breaking change which fixes an issue)
  • Breaking change (a code change causing existing functionality to break)
  • New feature (new holidays functionality in general)

Checklist

Copy link
Contributor

coderabbitai bot commented Mar 13, 2025

Summary by CodeRabbit

  • New Features

    • Expanded the Taiwan holiday calendar to include additional observances and refined scheduling rules for greater accuracy.
    • Introduced new holiday entries to enhance cultural representation and overall coverage.
    • Improved localization with updated translations and metadata across multiple languages.
  • Documentation

    • Updated holiday documentation to reflect the expanded categories and revised holiday details.

Walkthrough

The pull request updates Taiwan's holiday support across multiple files. The README.rst reflects an expanded list of supported holiday categories. The Taiwan class in holidays/countries/taiwan.py is enhanced with new methods and an updated start year for holiday observance. Localization files in several languages have been revised to include new metadata and translations for various holidays. The TW_COMMON.json file is significantly expanded with new holiday entries and observances. Additionally, the test suite is updated to cover the new categories and improved assertions.

Changes

File(s) Change Summary
README.rst Updated supported holiday categories for Taiwan—expanded from a single entry (zh_TW) to include GOVERNMENT, OPTIONAL, SCHOOL, and WORKDAY.
holidays/countries/taiwan.py Updated start year from 1912 to 1998; introduced supported_categories attribute and added methods to populate school, government, optional, and workday holidays; refined holiday logic and observance handling.
holidays/locale/{en_US, th, zh_CN, zh_TW}/LC_MESSAGES/TW.po Updated metadata (version, revision date, translator, generator) and modified holiday entries (e.g., renaming "Tomb Sweeping Day" to match localized revisions, simplifying "National Day"); added numerous new holiday translation entries.
snapshots/countries/TW_COMMON.json Extensive updates: added numerous new holiday entries and observances over multiple years, combined holiday descriptions, and incorporated observed days for certain holidays.
tests/countries/test_taiwan.py Expanded test coverage by updating the testing year range from 1990–2030 to 1998–2050; added tests for additional holiday categories (GOVERNMENT, OPTIONAL, SCHOOL, WORKDAY) and updated assertions (including renamed holidays).

Suggested reviewers

  • KJhellico

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8375985 and d443c07.

📒 Files selected for processing (1)
  • tests/countries/test_taiwan.py (15 hunks)
🧰 Additional context used
🧠 Learnings (1)
tests/countries/test_taiwan.py (1)
Learnt from: PPsyrius
PR: vacanza/holidays#2349
File: tests/countries/test_taiwan.py:0-0
Timestamp: 2025-03-13T15:17:45.519Z
Learning: For Taiwan's holiday system, different categories (GOVERNMENT, OPTIONAL, SCHOOL, WORKDAY) have distinct uses and contexts, justifying separate instances rather than parameterization in tests.
⏰ Context from checks skipped due to timeout of 300000ms (1)
  • GitHub Check: Test build on windows-latest
🔇 Additional comments (8)
tests/countries/test_taiwan.py (8)

15-15: Good consistency for holiday category constants.

The introduction of GOVERNMENT, OPTIONAL, PUBLIC, SCHOOL, and WORKDAY helps keep the code organized and transparent. This aligns well with your goal of adding support for multiple holiday categories.


23-23: Great approach to centralize the year ranges.

Defining years = range(1998, 2050) in one place promotes easier maintainability as you expand test coverage.


25-29: Clear categorization of Taiwan holidays instances.

Separating government_holidays, optional_holidays, school_holidays, and workday_holidays makes the test suite more logical and targeted. This avoids confusion and neatly aligns with real-life distinctions.


137-145: Well-structured test for 'foundation day' variations.

The separate checks for holiday presence and absence across specific years ensure thorough coverage of changes in holiday policies after 2000.


268-289: Thoughtful coverage for Taoism Day alignment with the Lunar New Year.

Verifying it only from 2001 onward and ensuring no overlap in earlier years demonstrates careful consideration of the historical start date.


321-330: Good introduction of 'anti-aggression day' checks.

Ensuring it appears correctly only from 2006 onwards and is absent for earlier years protects against regressions and clarifies historical changes.


694-702: Straightforward test for 'chinese_cultural_renaissance_day'.

This is a solid approach to confirm that the holiday name is absent for the relevant categories. Good use of assertNoHolidayName for coverage.


1259-1283: Comprehensive localization testing (default).

Including multiple languages and categories in the same test method ensures you catch potential collisions or omissions in the holiday naming logic. Nicely done.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Mar 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (7e9925d) to head (d443c07).
Report is 2 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #2349   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          204       204           
  Lines        12809     12853   +44     
  Branches      1810      1817    +7     
=========================================
+ Hits         12809     12853   +44     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f788ec0 and 53b0367.

📒 Files selected for processing (8)
  • README.rst (1 hunks)
  • holidays/countries/taiwan.py (6 hunks)
  • holidays/locale/en_US/LC_MESSAGES/TW.po (4 hunks)
  • holidays/locale/th/LC_MESSAGES/TW.po (4 hunks)
  • holidays/locale/zh_CN/LC_MESSAGES/TW.po (4 hunks)
  • holidays/locale/zh_TW/LC_MESSAGES/TW.po (4 hunks)
  • snapshots/countries/TW_COMMON.json (1 hunks)
  • tests/countries/test_taiwan.py (16 hunks)
🔇 Additional comments (48)
README.rst (1)

883-883: Categories alignment looks good.

The addition of GOVERNMENT, OPTIONAL, SCHOOL, and WORKDAY for Taiwan aligns well with the PR objectives and clarifies category support.

tests/countries/test_taiwan.py (22)

15-15: New constants import looks fine.
No syntactical or logical concerns with adding these constants to the test.


23-28: Setup for multi-category tests is correct.
Initializing separate Taiwan instances for each category from 1999 to 2050 is consistent with the updated start_year.


34-35: Ensuring no holidays exist pre-1999.
Verifying that 1998 yields no relevant holidays is coherent with the shift to start_year=1999.


39-47: Substituted holidays list updated.
These substituted holiday dates reflect the new logic and seem accurate.


84-92: Workday checks for historical Saturdays.
These tests correctly verify non-holidays on specific Saturdays.


135-140: Government holiday checks for pre-2001.
Testing “中華民國開國紀念日” only for 1999–2000 under GOVERNMENT is consistent with the new rules.


157-157: New function name for CNY test is informative.
No issues with refactoring the method name to align with changes.


179-179: Extending CNY Eve checks to entire range.
Testing it for all years ≥1999 is aligned with updated coverage.


195-195: Documentation comment updated.
No concerns; clarifies CNY Day 2 scope.


208-225: CNY Day 3 tests updated.
Expanded test dates thoroughly match the holiday definition for day 3.


245-266: New Taoism Day checks.
Testing with wrk_holidays and verifying partial-year coverage is correct.


280-288: Arbor Day tests.
No logical issues; properly added for the correct category.


290-297: Dr. Sun Yat-sen's Memorial Day checks.
Workday coverage fits the newly introduced category design.


299-307: Anti-Aggression Day coverage.
No concerns with year-based introduction and category checks.


309-323: Revolutionary Martyrs Memorial Day.
Properly split between government prior to 2001 and workday afterwards.


325-332: Youth Day as workday.
Implementation logic aligns with updated data.


336-339: Optional Children's Day coverage for early years.
Implementation matches pre-2001 logic with the new category handling.


341-343: Public holiday shift for Children’s Day post-2011.
Covers consistent date ranges with the new approach.


356-361: Workday checks for Children’s Day.
No issues with verifying older coverage in the WORKDAY category.


362-375: Women’s Day test logic.
Splitting optional vs. workday coverage by year is valid and consistent.


376-556: General holiday expansions.
These newly added or modified lines across multiple holiday tests look properly aligned with the updated set of categories.


563-1162: Remaining holiday test expansions.
All newly introduced or revised lines verify holiday names, categories, and observed rules thoroughly. No additional issues spotted.

holidays/countries/taiwan.py (10)

33-35: Updated imports look fine.
Including _timedelta and new constants is consistent with usage in this module.


49-79: Enhanced docstring references.
These official references and historical decrees reinforce the correctness of new logic.


100-112: Observance rule adjustments.
The clarifications regarding Children's Day special observation starting in 2012 and the general rule from 2015 are helpful and accurate.


113-133: School holidays population method.
Defining older-year holiday rules for YEAR ≤ 2000 is logically coherent with the new start_year=1999.


134-140: Government holidays now extend school logic.
Approach ensures early-year coverage merges properly with additional conditions.


150-160: Public holidays: extended coverage.
Inclusion of Peace Memorial Day and new logic for children’s day aligns with updated tests.


179-183: Forward observance rule for Chinese New Year.
Applying a custom next-workday shift from 2003 is consistent with DGPA’s prior practice.


185-201: Optional holidays logic.
Incorporating labor day and armed forces day expansions matches expected behavior.


202-264: Workday holidays segment.
The newly introduced definitions for Taoism Day, Dr. Sun Yat-sen’s Memorial & Birthday, Women’s Day, etc., accurately reflect the newly supported WORKDAY category.


275-382: StaticHolidays expansions.
All references to DGPA Work Calendars and the introduced substituted holiday logic for specific years ensure thorough coverage of special cases.

holidays/locale/zh_TW/LC_MESSAGES/TW.po (4)

55-57: Holiday name update looks good.

The renaming from "清明節" to "民族掃墓節" aligns with the PR objective to refine localization based on actual sources.


67-69: Holiday name simplification looks good.

The simplification to "國慶日" from the longer form is consistent with the PR objectives.


80-158: New holiday entries added successfully.

The addition of numerous new holiday entries enhances the comprehensiveness of Taiwan's holiday catalog and supports the new category system mentioned in the PR objectives.


17-20:

❌ Incorrect review comment

Check the revision date - it appears to be set to 2025.

The PO-Revision-Date is set to 2025-03-13, which is in the future. This might cause issues with timestamp validation or sorting. Consider updating it to the current year (2024).


🏁 Script executed:

#!/bin/bash
# Check if other localization files in the project also use future dates

echo "Checking for future dates in PO files..."
rg "PO-Revision-Date: 2025" --type po

Length of output: 7142


Revision Dates Aligned with Our Current Release Year

After verifying the PO files across all locales, it's clear that the PO-Revision-Date values (e.g., "2025-03-13" in holidays/locale/zh_TW/LC_MESSAGES/TW.po) are consistently set to 2025. Given that our current timeline is now March 2025, these dates are valid and not in the future. Please disregard the earlier suggestion to change the revision dates to 2024.

Likely an incorrect or invalid review comment.

holidays/locale/zh_CN/LC_MESSAGES/TW.po (3)

17-20: Check the revision date - it appears to be set to 2025.

The PO-Revision-Date is set to 2025-03-13, which is in the future. Consider updating it to the current year (2024).


55-57: Holiday name update and translation look good.

The renaming and translation are consistent with the zh_TW source update.


80-158: New holiday entries and translations added successfully.

All the new holiday entries have appropriate simplified Chinese translations that maintain consistency with the traditional Chinese source text.

holidays/locale/th/LC_MESSAGES/TW.po (2)

17-20: Check the revision date - it appears to be set to 2025.

The PO-Revision-Date is set to 2025-03-13, which is in the future. Consider updating it to the current year (2024).


80-158: Thai translations look thorough and comprehensive.

The Thai translations for all new holiday entries appear to be well-written and complete. The extensive additions align well with the PR objectives to enhance holiday categorization support.

holidays/locale/en_US/LC_MESSAGES/TW.po (2)

17-20: Check the revision date - it appears to be set to 2025.

The PO-Revision-Date is set to 2025-03-13, which is in the future. Consider updating it to the current year (2024).


80-158: English translations for new holidays look good.

All the new holiday entries have been properly translated to English, supporting the enhanced categorization system mentioned in the PR objectives.

snapshots/countries/TW_COMMON.json (4)

1-1391: Overall JSON Structure and Consistency
This snapshot file is a comprehensive and well‐formatted JSON mapping of Taiwan holiday definitions. The update successfully shifts the start date to 1999 and covers an extensive range from 1999 to 2050. All entries appear to be chronologically sorted and the format (key–value pair) is consistent throughout. Please double‐check that every holiday name exactly reflects the latest official sources and that no entries are inadvertently omitted.


168-168: New Holiday Entry: Anti-Aggression Day
The inclusion of "Anti-Aggression Day" (as seen on line 168) is an important addition that reflects the updated holiday observances. Please verify that its naming and placement align with the official documentation and the updated localization guidelines.


684-686: Taiwan United Nations Day and Retrocession Entries
The entries for "Taiwan United Nations Day" and "Taiwan Retrocession Day" have been added (e.g., around lines 684–686). Confirm that these new holiday titles are correctly localized, reflect the proper categorization, and integrate seamlessly with the new categories support introduced in the related code.


1365-1389: Later Years Coverage and Consistency Checks
The holiday definitions for the later years (e.g., from 2050 up to line 1389) have been updated with details including “(observed)” notes and substitution days. Given the extensive time span covered, please ensure that these entries maintain consistent formatting and accurately reflect any changes mandated by the updated holiday support. It may be worthwhile to run a final automated JSON linting and cross‐check against official calendars.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 53b0367 and 5f32d9c.

📒 Files selected for processing (1)
  • tests/countries/test_taiwan.py (16 hunks)
🔇 Additional comments (60)
tests/countries/test_taiwan.py (60)

34-35: Checks for non-existing holidays look correct.


39-80: Substituted holidays coverage is thorough.


84-125: Working day assertions appear consistent and well-aligned with category definitions.


135-156: New Year's Day category checks are accurate.


157-223: Comprehensive Chinese New Year tests.


245-266: Taoism Day (WORKDAY category) coverage is properly verified.


270-271: Peace Memorial Day tests align well with public-holiday rules.


280-288: Arbor Day coverage ensures correct mapping to WORKDAY.


289-297: Dr. Sun Yat-sen’s Memorial Day checks confirm correct inclusion under WORKDAY.


298-307: Anti-Aggression Day coverage is consistent with the new definitions.


308-323: Revolutionary Martyrs Memorial Day correctly tested for GOVERNMENT and WORKDAY categories.


324-332: Youth Day verification is well-defined for WORKDAY.


336-361: Children’s Day tests cover OPTIONAL, PUBLIC, and WORKDAY categories thoroughly.


362-375: Women’s Day inclusion under OPTIONAL and WORKDAY is consistent.


377-378: Tomb-Sweeping Day renaming and coverage are valid.


405-424: Late President Chiang Kai-shek’s Memorial Day coverage is accurate across WORKDAY.


425-433: Labor Day checks confirm OPTIONAL category usage.


434-461: The Buddha’s Birthday tests align with multiple categories and historical references.


465-465: Public-holiday comment addition is fine.


489-498: Commemoration Day of the Lifting of Martial Law test is valid for WORKDAY.


499-507: Armed Forces Day coverage in OPTIONAL is correct.


511-511: Mid-Autumn Festival public-holiday comment is clear.


536-540: National Day checks are consistent with the public-holiday rules.


548-569: Confucius’ Birthday verification across GOVERNMENT, SCHOOL, and WORKDAY is correct.


570-578: Teacher’s Day enumerations under WORKDAY are well-covered.


579-588: Taiwan United Nations Day coverage looks properly categorized.


589-610: Taiwan Retrocession Day checks confirm valid coverage across multiple categories.


611-632: Late President Chiang Kai-shek’s Birthday categorization is correctly handled.


633-654: Dr. Sun Yat-sen’s Birthday coverage for GOVERNMENT, SCHOOL, WORKDAY is accurate.


655-663: Chinese Cultural Renaissance Day recognized in WORKDAY as intended.


664-685: Constitution Day’s multi-category tests align with historical references.


686-700: Test 2001 coverage ensures the newly categorized holidays are correct.


702-715: Test 2002 expansions maintain consistency with the adjusted start date.


717-732: Test 2003 additions continue to confirm correct holiday handling.


734-748: Test 2004 fixtures comply with the new category rules.


750-764: Test 2005 is accurate for the enumerated days and rest periods.


766-781: Test 2006 data strongly verifies broader coverage.


783-802: Test 2007’s substituted holidays and rest days look solid.


804-818: Test 2008 coverage of eve/celebration days remains consistent.


820-837: Test 2009 reflects the new categories properly, including rest days.


840-855: Test 2010 holiday definitions align with updated rules.


858-872: Test 2011’s expansions continue consistent coverage.


875-891: Test 2012 ensures correct observation of spring and child-related holidays.


894-911: Test 2013 broadens the spring festival checks.


914-929: Test 2014 coverage properly accounts for CNY and tomb-sweeping.


932-953: Test 2015 includes advanced rest day logic.


956-974: Test 2016 data continues thorough verification of multi-day events.


977-996: Test 2017 encompasses additional celebration days and rest logic.


999-1016: Test 2018 coverage picks up refined observation logic.


1019-1035: Test 2019 confirms correct interplay of consecutive holiday days.


1038-1058: Test 2020 verifies alignment of singled-out rest days and extended celebrations.


1061-1081: Test 2021 captures the rearranged substitutable days well.


1085-1100: Test 2022 ensures each newly introduced category is enforced across Arbor Day and beyond.


1103-1125: Test 2023 coverage thoroughly verifies adjusted rest and holiday logic.


1128-1144: Test 2024 verification upholds continuity for next year transitions.


1147-1162: Test 2025 scenario robustly checks further expansions and celebratory overrides.


1168-1192: Localization default coverage—verifies that new categories appear correctly in zh_TW.


1199-1223: English (en_US) localization updates confirm expanded holiday names.


1230-1254: Thai (th) localization coverage includes newly added categories and translations.


1261-1285: Chinese (zh_CN) localization checks reflect the updated holiday definitions and naming.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🔭 Outside diff range comments (1)
tests/countries/test_taiwan.py (1)

37-127: 🧹 Nitpick (assertive)

Thorough coverage of substituted and workday tests.
These enumerations look correct and align with official records. If needed, you could streamline this by parameterizing the date ranges in a single table-driven test to reduce the duplication.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d2eea0a and f807cfe.

📒 Files selected for processing (3)
  • holidays/countries/taiwan.py (6 hunks)
  • snapshots/countries/TW_COMMON.json (1 hunks)
  • tests/countries/test_taiwan.py (16 hunks)
🔇 Additional comments (28)
tests/countries/test_taiwan.py (8)

15-15: Imports for new categories look good.
They align with the objectives for expanded holiday categories.


34-35: Pre-1999 logic validation is consistent.
Verifying empty holidays for 1998 meets the new start date.


137-158: Good clarity around multiple category checks for New Year’s Day.
This ensures each category is accounted for. Looks correct.


159-225: Chinese New Year coverage appears comprehensive.
Great to see multi-day coverage. Observed vs. non-observed logic is straightforward, too.


247-268: New Taoism Day checks.
Verifying presence in WORKDAY category while ensuring it doesn’t appear in others is correct.


270-687: Extensive holiday category checks.
All of these method-level tests for holidays (Peace Memorial, Arbor Day, etc.) thoroughly validate presence and absence across categories and year thresholds. This is solid coverage reflecting real-world holiday differences.


688-1166: Year-by-year test expansions.
Including annual details from 2001 through 2025 ensures robust validation. Retaining these chronological checks helps confirm no regressions occur in varied contexts.


1167-1289: Localization tests look well-structured.
Multiple locales ensure accurate naming and observed-labeled collisions are handled. No issues spotted.

holidays/countries/taiwan.py (16)

33-33: Importing _timedelta is consistent with holiday date calculations.
No concerns here.


35-35: Expanded import of categories is appropriate.
This matches the test suite usage.


49-69: Docstring enhancements are thorough.
Citing all relevant orders clarifies the basis for holiday definitions. This documentation fosters maintainability.


75-75: Adjusted start_year to 1999.
Double-check if any external cases require pre-1999 data. Otherwise, this is correct per the new reference date.


101-111: Children’s Day rule adjustment is well documented.
Good that you clarify how it merges with Tomb-Sweeping Day. The code implementing this looks clean.


113-115: Separate _populate_school_holidays method.
Neatly segregated logic for school-specific commemorations.


133-133: Add-on _populate_government_holidays.
Consistent with the new approach of specialized population methods.


159-159: Peace Memorial Day line updated.
Works as expected.


162-162: Condition for 2011 aligns with historical references.
No issues spotted.


166-166: Renaming to “Tomb-Sweeping Day.”
Local naming aligns with the rest of the code.


176-176: National Day simplified.
Straightforward approach.


180-180: Observed rule for CNY.
Applying an earlier year threshold clarifies real historical data.


184-184: Creation of _populate_optional_holidays.
Matches the new structure and helps modularize the logic.


201-264: Workday-based holidays.
Placing these in _populate_workday_holidays centralizes single-day events. Clear addition of relevant days (Arbor Day, Taoism Day, etc.).


274-274: StaticHolidays class reference.
Separating them is beneficial for clarity and maintainability.


276-383: Complete references to DGPA calendars.
All these lines provide valuable historical data for year-specific overrides. Comprehensive approach.

snapshots/countries/TW_COMMON.json (4)

1-3: Updated Start Date Confirmed
The snapshot now begins with holidays for 1999—this aligns with the PR’s change from 1912 to 1999 based on the official document. Since this file is auto‐generated via the make snapshot command, please ensure that any further adjustments to the start date are made in the generator configuration.


9-12: Composite Holiday Names Format
Entries such as line 9 (“Arbor Day; Dr. Sun Yat-sen's Memorial Day”) continue to use semicolon delimiters to represent multiple observances. This format is consistent with previous snapshots. Given that this file is auto-generated, any desired improvements in structuring (e.g. moving to an object format with separate keys for names and categories) must be applied to the snapshot generator.


46-47: Substitution Note Check
The entry on line 46 ("Day off (substituted from 01/20/2001)") is formatted correctly and clearly documents the substitution. Please verify that similar substitution entries across the snapshot continue to reflect the official work calendar data consistently.


1-1392: Overall Snapshot File Review
This updated snapshot for Taiwan holidays reflects the extensive modifications required by the PR objectives—including the revised start date and the comprehensive holiday entries from 1999 through 2050. Note that the file still outputs holiday names as simple strings (using semicolon delimiters), which is acceptable as it is auto‑generated. If structured holiday category support is desired in the JSON output, the changes should be made in the underlying generator code rather than by manually editing this file.

Copy link
Collaborator

@KJhellico KJhellico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's very impressive! 👍

@PPsyrius PPsyrius requested a review from KJhellico March 13, 2025 15:07
KJhellico
KJhellico previously approved these changes Mar 14, 2025
Copy link
Collaborator

@KJhellico KJhellico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link

Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@arkid15r arkid15r enabled auto-merge March 15, 2025 02:26
@arkid15r arkid15r added this pull request to the merge queue Mar 15, 2025
Merged via the queue into vacanza:dev with commit 72d70ef Mar 15, 2025
33 checks passed
@PPsyrius PPsyrius deleted the taiwan_categories branch March 15, 2025 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Taiwan's unofficial holidays

3 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载