8000 Add Bermuda holidays by kritibirda26 · Pull Request #2571 · vacanza/holidays · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add Bermuda holidays #2571

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 7 commits into from
Jun 2, 2025
Merged

Add Bermuda holidays #2571

merged 7 commits into from
Jun 2, 2025

Conversation

kritibirda26
Copy link
Collaborator

Resolves #2412.

Proposed change

Add Bermuda holidays

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 May 27, 2025

Summary by CodeRabbit

  • New Features
    • Added support for Bermuda's public holidays, including standard holidays and special one-off holidays, from 1948 onward.
  • Documentation
    • Updated documentation to reflect the addition of Bermuda as a supported country.
  • Tests
    • Introduced comprehensive tests to verify Bermuda holiday calculations and aliases.

Summary by CodeRabbit

  • New Features
    • Added support for Bermuda's public holidays, including historical and special one-off holidays, with accurate observance rules.
  • Documentation
    • Updated documentation to reflect the addition of Bermuda and the increase in supported country codes.
  • Tests
    • Introduced a comprehensive test suite to ensure correct calculation and observance of Bermuda's holidays.

Walkthrough

Support for Bermuda's public holidays has been added. This includes a new Bermuda holiday provider, integration into the registry, documentation updates, and a comprehensive test suite verifying holiday logic and edge cases from 1948 onward.

Changes

Files/Paths Change Summary
README.md Updated supported countries count and added Bermuda to the country table.
holidays/countries/bermuda.py New file: Defines Bermuda holiday logic, aliases, and special one-off holidays.
holidays/countries/init.py Added Bermuda imports for main and alias classes.
holidays/registry.py Registered Bermuda in the countries dictionary.
tests/countries/test_bermuda.py New: Comprehensive tests for Bermuda holidays, observed rules, and special holidays.

Assessment against linked issues

Objective (Issue #) Addressed Explanation
Add Bermuda holidays (#2412)

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes detected.

Suggested labels

l10n

Suggested reviewers

  • KJhellico
  • PPsyrius

📜 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 157d093 and 3ac51aa.

📒 Files selected for processing (2)
  • holidays/countries/bermuda.py (1 hunks)
  • tests/countries/test_bermuda.py (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
holidays/countries/bermuda.py (2)
Learnt from: KJhellico
PR: vacanza/holidays#2524
File: holidays/countries/grenada.py:81-83
Timestamp: 2025-05-03T20:16:58.203Z
Learning: In the Vacanza holidays library, localization (l10n) comments are always written in American English (en_US locale), even when the translatable strings use different regional spellings. For example, comments use "Labor Day" while the corresponding translatable string might use "Labour Day".
Learnt from: KJhellico
PR: vacanza/holidays#2571
File: holidays/countries/bermuda.py:108-110
Timestamp: 2025-05-31T15:11:42.143Z
Learning: In the holidays library project, alias classes (like BM, BMU) do not have docstrings. This is a project-specific convention.
tests/countries/test_bermuda.py (1)
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.
🪛 Pylint (3.3.7)
holidays/countries/bermuda.py

[convention] 26-26: Line too long (167/100)

(C0301)


[convention] 27-27: Line too long (188/100)

(C0301)


[convention] 28-28: Line too long (188/100)

(C0301)


[convention] 29-29: Line too long (212/100)

(C0301)


[convention] 30-30: Line too long (188/100)

(C0301)


[convention] 31-31: Line too long (188/100)

(C0301)


[convention] 32-32: Line too long (112/100)

(C0301)


[convention] 33-33: Line too long (208/100)

(C0301)


[convention] 120-120: Line too long (163/100)

(C0301)


[convention] 122-122: Line too long (161/100)

(C0301)


[convention] 123-123: Line too long (180/100)

(C0301)


[convention] 125-125: Line too long (131/100)

(C0301)


[convention] 126-126: Line too long (183/100)

(C0301)


[convention] 128-128: Line too long (148/100)

(C0301)


[convention] 129-129: Line too long (178/100)

(C0301)


[convention] 1-1: Missing module docstring

(C0114)


[convention] 108-108: Missing class docstring

(C0115)


[convention] 112-112: Missing class docstring

(C0115)


[refactor] 116-116: Too few public methods (0/2)

(R0903)

tests/countries/test_bermuda.py

[convention] 1-1: Missing module docstring

(C0114)


[convention] 19-19: Missing class docstring

(C0115)


[warning] 21-21: Number of parameters was 4 in 'TestCase.setUpClass' and is now 1 in overriding 'TestBermuda.setUpClass' method

(W0221)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)

🔇 Additional comments (16)
tests/countries/test_bermuda.py (8)

19-26: Test class structure looks solid.

Good use of CommonCountryTests for shared functionality and proper setup of the test years range. The alias testing is correctly implemented.

🧰 Tools
🪛 Pylint (3.3.7)

[convention] 19-19: Missing class docstring

(C0115)


[warning] 21-21: Number of parameters was 4 in 'TestCase.setUpClass' and is now 1 in overriding 'TestBermuda.setUpClass' method

(W0221)


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

(C0116)


31-38: Special holidays test is well-structured.

The special holidays are properly tested with their specific dates and names. This covers the one-off holidays mentioned in the PR objectives.

🧰 Tools
🪛 Pylint (3.3.7)

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

(C0116)


40-51: New Year's Day test demonstrates good observed holiday handling.

The test correctly validates both the regular holiday dates and the observed dates when the holiday falls on a weekend.

🧰 Tools
🪛 Pylint (3.3.7)

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

(C0116)


65-88: Bermuda Day test captures the historical date changes accurately.

The test properly handles the complex evolution of Bermuda Day observance rules across different time periods, including the fixed May 24 dates and the transition to different calculation methods.

🧰 Tools
🪛 Pylint (3.3.7)

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

(C0116)


90-104: Queen's Birthday test correctly shows the discontinuation.

Good validation that Queen's Birthday was observed until 2008 and then discontinued, with proper range checks.

🧰 Tools
🪛 Pylint (3.3.7)

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

(C0116)


123-146: Cup Match/Emancipation Day transition is well-tested.

The test accurately captures the name change from "Cup Match Day" to "Emancipation Day" in 2000, with proper date validation for both periods.

🧰 Tools
🪛 Pylint (3.3.7)

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

(C0116)


148-171: Somers/Mary Prince Day transition is properly handled.

The test correctly validates the transition from "Somers Day" to "Mary Prince Day" in 2020, which aligns with the Public Holidays Amendment Act 2020 mentioned in past comments.

🧰 Tools
🪛 Pylint (3.3.7)

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

(C0116)


226-239: 2025 comprehensive test provides good validation.

This test serves as a valuable snapshot validation for a complete year, ensuring all expected holidays are present with correct names.

🧰 Tools
🪛 Pylint (3.3.7)

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

(C0116)

holidays/countries/bermuda.py (8)

22-45: Class design and initialization are well-structured.

The multiple inheritance from the appropriate mixins provides good functionality composition. The initialization properly sets up all parent classes and provides sensible defaults for observed holiday rules.

🧰 Tools
🪛 Pylint (3.3.7)

[convention] 26-26: Line too long (167/100)

(C0301)


[convention] 27-27: Line too long (188/100)

(C0301)


[convention] 28-28: Line too long (188/100)

(C0301)


[convention] 29-29: Line too long (212/100)

(C0301)


[convention] 30-30: Line too long (188/100)

(C0301)


[convention] 31-31: Line too long (188/100)

(C0301)


[convention] 32-32: Line too long (112/100)

(C0301)


[convention] 33-33: Line too long (208/100)

(C0301)


47-53: Basic holidays are properly implemented.

New Year's Day and Good Friday are correctly set up with appropriate observed holiday handling.


54-63: Bermuda Day logic captures historical evolution well.

The conditional logic properly handles the different calculation methods used across various time periods, including the special case for 2019 mentioned in the PR objectives.


65-77: Queen's Birthday and National Heroes Day transitions are accurate.

The logic correctly implements the discontinuation of Queen's Birthday after 2008 and the introduction of National Heroes Day, with proper date calculation methods for different periods.


79-93: Cup Match/Emancipation and Somers/Mary Prince Day logic is sound.

The conditional expressions elegantly handle the name transitions while using the same date calculation methods. This matches the historical changes documented in the amendments.


95-105: Final holidays are properly configured.

Labour Day, Remembrance Day, Christmas Day, and Boxing Day are correctly set up with appropriate observed holiday rules, including the special SAT_SUN_TO_NEXT_MON_TUE rule for Christmas holidays.


108-113: Alias classes follow project conventions.

The BM and BMU alias classes correctly inherit from Bermuda and follow the project's convention of not having docstrings, as confirmed in the retrieved learnings.

🧰 Tools
🪛 Pylint (3.3.7)

[convention] 108-108: Missing class docstring

(C0115)


[convention] 112-112: Missing class docstring

(C0115)


116-141: Static holidays class is well-documented and structured.

The BermudaStaticHolidays class properly defines the special one-off holidays with comprehensive documentation references. The structure follows the expected pattern for static holiday definitions.

🧰 Tools
🪛 Pylint (3.3.7)

[convention] 120-120: Line too long (163/100)

(C0301)


[convention] 122-122: Line too long (161/100)

(C0301)


[convention] 123-123: Line too long (180/100)

(C0301)


[convention] 125-125: Line too long (131/100)

(C0301)


[convention] 126-126: Line too long (183/100)

(C0301)


[convention] 128-128: Line too long (148/100)

(C0301)


[convention] 129-129: Line too long (178/100)

(C0301)


[refactor] 116-116: Too few public methods (0/2)

(R0903)

✨ Finishing Touches
  • 📝 Generate Docstrings

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

@github-actions github-actions bot added the test label May 27, 2025
@kritibirda26
Copy link
Collaborator Author

I could not find the original text of the Public Holidays Amendment Act 1947, only the consolidated version containing all the amendments. But I have implemented the holidays by trying to reconstruct it from the amendments and old captures from Internet Archive.

Copy link
codecov bot commented May 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (1fd2b16) to head (3ac51aa).
Report is 2 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #2571   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          224       225    +1     
  Lines        14315     14362   +47     
  Branches      2010      2017    +7     
=========================================
+ Hits         14315     14362   +47     

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

I haven't looked at the sources yet, so just technical suggestions.

@KJhellico
Copy link
Collaborator

June 5, 2007 Public Holiday
2019 Bermuda Day on May 24 (instead of May 31)

Official sources for
Nov 4, 2019 (Portuguese Public Holiday)
Oct 18, 2021 (Flora Duffy Day)
May 8, 2023 (Coronation of Charles III)

But they don't contain holiday name, so it's better not to replace the existing ones, but rather to add them as an addition.

kritibirda26 and others added 4 commits May 31, 2025 17:31
Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>
Co-authored-by: Panpakorn Siripanich <19505219+PPsyrius@users.noreply.github.com>
Signed-off-by: Kriti Birda <164247895+kritibirda26@users.noreply.github.com>
add cup match/emancipation day test
fix somers days/mary prince test
fix bermuda day test for 2020
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: 3

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 76e73d2 and 225434f.

📒 Files selected for processing (5)
  • README.md (2 hunks)
  • holidays/countries/__init__.py (1 hunks)
  • holidays/countries/bermuda.py (1 hunks)
  • holidays/registry.py (1 hunks)
  • tests/countries/test_bermuda.py (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
tests/countries/test_bermuda.py (1)
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.
holidays/countries/bermuda.py (1)
Learnt from: KJhellico
PR: vacanza/holidays#2524
File: holidays/countries/grenada.py:81-83
Timestamp: 2025-05-03T20:16:58.203Z
Learning: In the Vacanza holidays library, localization (l10n) comments are always written in American English (en_US locale), even when the translatable strings use different regional spellings. For example, comments use "Labor Day" while the corresponding translatable string might use "Labour Day".
🧬 Code Graph Analysis (1)
holidays/countries/__init__.py (1)
holidays/countries/bermuda.py (3)
  • Bermuda (22-105)
  • BM (108-109)
  • BMU (112-113)
🪛 Pylint (3.3.7)
tests/countries/test_bermuda.py

[convention] 1-1: Missing module docstring

(C0114)


[convention] 19-19: Missing class docstring

(C0115)


[warning] 21-21: Number of parameters was 4 in 'TestCase.setUpClass' and is now 1 in overriding 'TestBermuda.setUpClass' method

(W0221)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)

holidays/countries/bermuda.py

[convention] 26-26: Line too long (167/100)

(C0301)


[convention] 27-27: Line too long (188/100)

(C0301)


[convention] 28-28: Line too long (188/100)

(C0301)


[convention] 29-29: Line too long (212/100)

(C0301)


[convention] 30-30: Line too long (188/100)

(C0301)


[convention] 31-31: Line too long (188/100)

(C0301)


[convention] 32-32: Line too long (112/100)

(C0301)


[convention] 33-33: Line too long (208/100)

(C0301)


[convention] 120-120: Line too long (163/100)

(C0301)


[convention] 122-122: Line too long (161/100)

(C0301)


[convention] 123-123: Line too long (180/100)

(C0301)


[convention] 125-125: Line too long (131/100)

(C0301)


[convention] 126-126: Line too long (183/100)

(C0301)


[convention] 128-128: Line too long (148/100)

(C0301)


[convention] 129-129: Line too long (178/100)

(C0301)


[convention] 1-1: Missing module docstring

(C0114)


[convention] 108-108: Missing class docstring

(C0115)


[convention] 112-112: Missing class docstring

(C0115)


[refactor] 116-116: Too few public methods (0/2)

(R0903)

🔇 Additional comments (16)
README.md (2)

108-108: Documentation correctly updated for new country support.

The country count increment from 180 to 181 properly reflects the addition of Bermuda.


304-309: Bermuda entry correctly added to countries table.

Good placement in alphabetical order between Benin and Bolivia. The entry follows the standard format with appropriate empty fields for subdivisions, languages, and categories.

holidays/countries/__init__.py (1)

37-37: Import statement correctly added for Bermuda support.

Follows the established pattern and maintains alphabetical ordering. All expected classes (Bermuda, BM, BMU) are properly imported.

holidays/registry.py (1)

45-45: Registry entry correctly added for Bermuda.

Proper tuple format with correct ISO codes (BM, BMU) and alphabetical placement maintained.

tests/countries/test_bermuda.py (8)

19-27: Well-structured test class with comprehensive coverage.

Good setup covering the full range from 1948-2050. Test structure follows established patterns and includes both observed and non-observed year testing.

🧰 Tools
🪛 Pylint (3.3.7)

[convention] 19-19: Missing class docstring

(C0115)


[warning] 21-21: Number of parameters was 4 in 'TestCase.setUpClass' and is now 1 in overriding 'TestBermuda.setUpClass' method

(W0221)


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

(C0116)


31-38: Special holidays properly tested.

Covers all the one-off holidays mentioned in the PR objectives - excellent attention to historical accuracy.

🧰 Tools
🪛 Pylint (3.3.7)

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

(C0116)


40-51: New Year's Day test follows best practices.

Good coverage of observed holiday rules with specific test cases for weekend adjustments.

🧰 Tools
🪛 Pylint (3.3.7)

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

(C0116)


65-89: Bermuda Day test captures complex evolution.

Well done testing the different rules over time - from fixed May 24 to various Friday/Monday calculations. The observed holiday testing is thorough.

🧰 Tools
🪛 Pylint (3.3.7)

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

(C0116)


90-102: Queen's Birthday test properly handles discontinuation.

Correctly tests that the holiday existed until 2008 and then stopped - good historical accuracy.

🧰 Tools
🪛 Pylint (3.3.7)

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

(C0116)


121-144: Cup Match/Emancipation Day transition well tested.

Properly captures the name change from "Cup Match Day" to "Emancipation Day" in 2000.

🧰 Tools
🪛 Pylint (3.3.7)

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

(C0116)


146-169: Somers/Mary Prince Day transition correctly tested.

Good coverage of another name change, this time in 2020.

🧰 Tools
🪛 Pylint (3.3.7)

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

(C0116)


224-237: Comprehensive 2025 integration test.

Nice summary test that validates the complete holiday set for a specific year.

🧰 Tools
🪛 Pylint (3.3.7)

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

(C0116)

holidays/countries/bermuda.py (4)

13-19: Imports look good.

The imports are well-organized and include all necessary components for the Bermuda holidays implementation.


22-46: Solid class structure and initialization.

The class properly inherits from all required mixins and sets appropriate defaults. The initialization correctly handles all parent classes and sets a sensible observed rule.

🧰 Tools
🪛 Pylint (3.3.7)

[convention] 26-26: Line too long (167/100)

(C0301)


[convention] 27-27: Line too long (188/100)

(C0301)


[convention] 28-28: Line too long (188/100)

(C0301)


[convention] 29-29: Line too long (212/100)

(C0301)


[convention] 30-30: Line too long (188/100)

(C0301)


[convention] 31-31: Line too long (188/100)

(C0301)


[convention] 32-32: Line too long (112/100)

(C0301)


[convention] 33-33: Line too long (208/100)

(C0301)


47-106: Holiday logic implementation looks comprehensive.

The holiday definitions cover all major Bermuda holidays with proper date calculations and observed rules. The logic correctly handles historical changes in holiday dates and names based on the legislative amendments.


116-142: Special holidays implementation is well-documented.

The static holidays class properly defines one-off holidays with comprehensive references. The structure follows the expected pattern for special holiday definitions.

🧰 Tools
🪛 Pylint (3.3.7)

[convention] 120-120: Line too long (163/100)

(C0301)


[convention] 122-122: Line too long (161/100)

(C0301)


[convention] 123-123: Line too long (180/100)

(C0301)


[convention] 125-125: Line too long (131/100)

(C0301)


[convention] 126-126: Line too long (183/100)

(C0301)


[convention] 128-128: Line too long (148/100)

(C0301)


[convention] 129-129: Line too long (178/100)

(C0301)


[refactor] 116-116: Too few public methods (0/2)

(R0903)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>
Signed-off-by: Kriti Birda <164247895+kritibirda26@users.noreply.github.com>
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

♻️ Duplicate comments (1)
holidays/countries/bermuda.py (1)

95-95: 🧹 Nitpick (assertive)

Use American English in code comments.

Per project convention, code comments should use American English spelling.

-        # Labor Day.
+        # Labor Day.
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 225434f and 157d093.

📒 Files selected for processing (1)
  • holidays/countries/bermuda.py (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
holidays/countries/bermuda.py (2)
Learnt from: KJhellico
PR: vacanza/holidays#2524
File: holidays/countries/grenada.py:81-83
Timestamp: 2025-05-03T20:16:58.203Z
Learning: In the Vacanza holidays library, localization (l10n) comments are always written in American English (en_US locale), even when the translatable strings use different regional spellings. For example, comments use "Labor Day" while the corresponding translatable string might use "Labour Day".
Learnt from: KJhellico
PR: vacanza/holidays#2571
File: holidays/countries/bermuda.py:108-110
Timestamp: 2025-05-31T15:11:42.143Z
Learning: In the holidays library project, alias classes (like BM, BMU) do not have docstrings. This is a project-specific convention.
🧬 Code Graph Analysis (1)
holidays/countries/bermuda.py (4)
holidays/groups/christian.py (3)
  • _add_good_friday (308-317)
  • _add_christmas_day (208-216)
  • _add_christmas_day_two (218-226)
holidays/groups/international.py (2)
  • _add_new_years_day (126-134)
  • _add_remembrance_day (166-174)
holidays/groups/custom.py (1)
  • StaticHolidays (18-47)
holidays/observed_holiday_base.py (1)
  • ObservedHolidayBase (101-243)
🪛 Pylint (3.3.7)
holidays/countries/bermuda.py

[convention] 26-26: Line too long (167/100)

(C0301)


[convention] 27-27: Line too long (188/100)

(C0301)


[convention] 28-28: Line too long (188/100)

(C0301)


[convention] 29-29: Line too long (212/100)

(C0301)


[convention] 30-30: Line too long (188/100)

(C0301)


[convention] 31-31: Line too long (188/100)

(C0301)


[convention] 32-32: Line too long (112/100)

(C0301)


[convention] 33-33: Line too long (208/100)

(C0301)


[convention] 120-120: Line too long (163/100)

(C0301)


[convention] 122-122: Line too long (161/100)

(C0301)


[convention] 123-123: Line too long (180/100)

(C0301)


[convention] 125-125: Line too long (131/100)

(C0301)


[convention] 126-126: Line too long (183/100)

(C0301)


[convention] 128-128: Line too long (148/100)

(C0301)


[convention] 129-129: Line too long (178/100)

(C0301)


[convention] 1-1: Missing module docstring

(C0114)


[convention] 108-108: Missing class docstring

(C0115)


[convention] 112-112: Missing class docstring

(C0115)


[refactor] 116-116: Too few public methods (0/2)

(R0903)

🪛 GitHub Actions: CI/CD
holidays/countries/bermuda.py

[error] 68-68: AttributeError: 'Bermuda' object has no attribute '_add_holiday_3rd_mon_of_june' called during test setup in TestBermuda.

🔇 Additional comments (2)
holidays/countries/bermuda.py (2)

22-46: Well-structured class definition.

The class properly inherits from all necessary mixins and the constructor correctly initializes each component. Good use of default observed rule and comprehensive documentation with official references.

🧰 Tools
🪛 Pylint (3.3.7)

[convention] 26-26: Line too long (167/100)

(C0301)


[convention] 27-27: Line too long (188/100)

(C0301)


[convention] 28-28: Line too long (188/100)

(C0301)


[convention] 29-29: Line too long (212/100)

(C0301)


[convention] 30-30: Line too long (188/100)

(C0301)


[convention] 31-31: Line too long (188/100)

(C0301)


[convention] 32-32: Line too long (112/100)

(C0301)


[convention] 33-33: Line too long (208/100)

(C0301)


116-142: Excellent static holidays implementation.

The special holidays are well-documented with authoritative references and follow the proper structure. The implementation correctly defines one-off holidays with appropriate dates and names.

🧰 Tools
🪛 Pylint (3.3.7)

[convention] 120-120: Line too long (163/100)

(C0301)


[convention] 122-122: Line too long (161/100)

(C0301)


[convention] 123-123: Line too long (180/100)

(C0301)


[convention] 125-125: Line too long (131/100)

(C0301)


[convention] 126-126: Line too long (183/100)

(C0301)


[convention] 128-128: Line too long (148/100)

(C0301)


[convention] 129-129: Line too long (178/100)

(C0301)


[refactor] 116-116: Too few public methods (0/2)

(R0903)

Copy link

@KJhellico
Copy link
Collaborator

Already LGTM, but maybe it's worth adding l10n (en_BM, en_US), since Labour Day holiday is present?

@arkid15r
F438 Copy link
Collaborator
arkid15r commented Jun 2, 2025

Already LGTM, but maybe it's worth adding l10n (en_BM, en_US), since Labour Day holiday is present?

I asked @KJhellico and we agreed that l10n part can be implemented after today's release)

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, great start for GSoC coding phase!

@arkid15r arkid15r added this pull request to the merge queue Jun 2, 2025
Merged via the queue into vacanza:dev with commit 16a81ca Jun 2, 2025
33 checks passed
@arkid15r arkid15r mentioned this pull request Jun 2, 2025
@KJhellico KJhellico mentioned this pull request Jun 6, 2025
9 tasks
@coderabbitai coderabbitai bot mentioned this pull request Jun 14, 2025
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Bermuda holidays
4 participants
0