+
Skip to content

Update Singapore holidays: add 2026 public holidays #2637

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 16, 2025

Conversation

PPsyrius
Copy link
Collaborator

Proposed change

Add 2026 Public Holidays [1] [2] for Singapore.

Resolves #2636 .

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 Jun 16, 2025

Summary by CodeRabbit

  • New Features
    • Added recognition of Singapore public holidays for 2026, including confirmed and observed dates for major religious and national holidays.
  • Bug Fixes
    • Updated several 2026 holiday dates and removed "(estimated)" labels to reflect finalized information.
  • Documentation
    • Updated reference link in the Singapore holidays documentation to a newer archived source.
  • Tests
    • Added tests to verify Singapore's 2026 public holidays, including observed days.

Walkthrough

The changes update Singapore's 2026 public holiday dates across the holiday calculation logic, snapshots, and tests. Confirmed holiday dates replace estimated ones, observed days are added, and a new test verifies the 2026 holiday set. Documentation is also updated with a new reference URL.

Changes

Files/Paths Change Summary
holidays/countries/singapore.py Updated docstring URL; added 2026 holiday date mappings for Buddhist, Chinese, Hindu, and Islamic holidays.
snapshots/countries/SG_COMMON.json Updated 2026 Singapore holiday entries: confirmed dates, removed "(estimated)", added observed days.
tests/countries/test_singapore.py Added test_2026 to assert all 2026 holidays and observed days.

Assessment against linked issues

Objective (Issue #) Addressed Explanation
Update Singapore 2026 official holidays (#2636)
Add/confirm observed days for holidays (#2636)
Add/adjust tests for 2026 holidays (#2636)

Suggested labels

snapshot, test

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Commit Unit Tests in branch sg_2026
  • Post Copyable Unit Tests in Comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests 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

Quality Gate Failed Quality Gate failed

Failed conditions
6.2% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Copy link

codecov bot commented Jun 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (8fa07c4) to head (696b68c).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #2637   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          232       232           
  Lines        14739     14739           
  Branches      2057      2057           
=========================================
  Hits         14739     14739           

☔ 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.

@PPsyrius
Copy link
Collaborator Author

Considering the number of false positive we get from SonarCloud's Code Analysis - is there a way to somewhat raise the threshold for code duplication? @arkid15r

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: 2

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 8fa07c4 and 696b68c.

📒 Files selected for processing (3)
  • holidays/countries/singapore.py (6 hunks)
  • snapshots/countries/SG_COMMON.json (1 hunks)
  • tests/countries/test_singapore.py (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
tests/countries/test_singapore.py (2)
Learnt from: PPsyrius
PR: vacanza/holidays#2386
File: tests/countries/test_nepal.py:499-536
Timestamp: 2025-04-05T06:49:06.217Z
Learning: In the holidays project, test files follow a dual testing approach: individual methods test specific holidays across multiple years, while comprehensive year-specific tests (e.g., `test_2025`) verify all holidays for a specific year in a single assertion. Both approaches serve different testing purposes and complement each other.
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:47:27.213Z
Learning: For holiday tests in the vacanza/holidays project, structure tests by individual holidays rather than by years. Each test method should focus on a specific holiday and test it across multiple years (from start_year through 2050) using helper methods like `assertHolidayName`. For fixed holidays, use generators like `(f"{year}-01-01" for year in range(1991, 2051))`. For movable holidays, specify individual dates for specific years followed by a range check.
🧬 Code Graph Analysis (1)
tests/countries/test_singapore.py (1)
tests/common.py (1)
  • assertHolidays (228-230)
🪛 Pylint (3.3.7)
holidays/countries/singapore.py

[convention] 49-49: Line too long (132/100)

(C0301)

tests/countries/test_singapore.py

[convention] 197-197: Missing function or method docstring

(C0116)

⏰ Context from checks skipped due to timeout of 300000ms (1)
  • GitHub Check: Test Python 3.13 on windows-latest
🔇 Additional comments (2)
holidays/countries/singapore.py (1)

180-306: Let’s pull down the PDF and extract text before matching dates – grepping a PDF stream won’t work. Trying a quick Python + pdfminer approach:

#!/bin/bash
set -e

# Download the official 2026 public-holidays PDF
url='https://www.mom.gov.sg/-/media/mom/documents/employment-practices/public-holidays/public-holidays-2026.pdf'
curl -sL "$url" -o public-holidays-2026.pdf

# Install a PDF‐to‐text extractor
pip install --quiet pdfminer.six

# Extract and list all “<day> <Month> 2026” occurrences
python3 - <<'EOF'
import re
from pdfminer.high_level import extract_text

text = extract_text('public-holidays-2026.pdf')
dates = sorted(set(re.findall(r'(\d{1,2} [A-Z][a-z]+ 2026)', text)))
print('\n'.join(dates))
EOF
snapshots/countries/SG_COMMON.json (1)

963-975: Snapshot perfectly mirrors code & tests

Confirmed that the 2026 snapshot lines match the constants and test_2026; good job keeping everything in sync.

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.

@coderabbitai coderabbitai bot mentioned this pull request Jun 16, 2025
9 tasks
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 added this pull request to the merge queue Jun 16, 2025
@arkid15r arkid15r removed this pull request from the merge queue due to a manual request Jun 16, 2025
@arkid15r arkid15r added this pull request to the merge queue Jun 16, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Jun 16, 2025
@arkid15r arkid15r added this pull request to the merge queue Jun 16, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Jun 16, 2025
@arkid15r arkid15r added this pull request to the merge queue Jun 16, 2025
@arkid15r
Copy link
Collaborator

Considering the number of false positive we get from SonarCloud's Code Analysis - is there a way to somewhat raise the threshold for code duplication? @arkid15r

I'll check what can be done there. Thanks for complaining 👍

Merged via the queue into vacanza:dev with commit 385811f Jun 16, 2025
31 of 32 checks passed
@arkid15r arkid15r mentioned this pull request Jun 16, 2025
@PPsyrius PPsyrius deleted the sg_2026 branch June 17, 2025 05:15
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.

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