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

Add Nauru holidays #2609

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

Add Nauru holidays #2609

merged 24 commits into from
Jun 14, 2025

Conversation

Roshan-1024
Copy link
Contributor

Proposed change

Add Nauru holidays.

Resolves #1233

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 6, 2025

Summary by CodeRabbit

  • New Features

    • Added support for Nauru public holidays, including observed rules and aliases.
    • Nauru (NR, NRU) now appears as a supported country.
  • Localization

    • Introduced English (Nauru) and English (US) translations for all Nauru holidays.
  • Documentation

    • Updated documentation to reflect Nauru as a supported country.
  • Tests

    • Added comprehensive tests for Nauru holiday definitions, observed dates, aliases, and localization.

Summary by CodeRabbit

  • New Features
    • Added support for Nauru's public holidays, including official and observed dates, to the holiday calendar.
    • Introduced country code aliases (NR, NRU) for easier reference to Nauru.
  • Documentation
    • Updated documentation to include Nauru as a supported country and reflect the new total of supported country codes.
  • Localization
    • Added initial English (en_NR) localization template for Nauru's holidays.
  • Tests
    • Implemented comprehensive tests to verify Nauru holiday calculations, observance rules, aliases, and localization.

Walkthrough

The changes introduce official support for Nauru holidays by adding a new country module, updating the registry, providing localization, and including comprehensive tests. Documentation and country lists are updated to reflect the new support. No existing logic is modified outside of adding Nauru.

Changes

Files/Groups Change Summary
holidays/countries/nauru.py New module: Defines the Nauru holiday provider with official and observed holidays, aliases.
tests/countries/test_nauru.py New test suite: Unit tests for Nauru holiday rules, observance, aliases, and localization.
holidays/locale/en_NR/LC_MESSAGES/NR.po New locale file: English (Nauru) translation template for holiday names and observed labels.
holidays/locale/en_US/LC_MESSAGES/NR.po New locale file: English (US) translations for Nauru holidays.
holidays/registry.py Added "nauru" to the country registry with codes "NR" and "NRU".
holidays/countries/init.py Imported Nauru and its aliases into the countries package.
README.md Updated documentation: Nauru added to supported countries and country code count incremented.

Assessment against linked issues

Objective (Issue #) Addressed Explanation
Add Nauru holidays (#1233)
Provide aliases and localization for Nauru (#1233)
Add tests for Nauru holidays and observance (#1233)
Update documentation and registry for Nauru (#1233)

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes detected.

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 d963cf5 and 2d8aea2.

📒 Files selected for processing (1)
  • holidays/locale/en_US/LC_MESSAGES/NR.po (1 hunks)
🔇 Additional comments (4)
holidays/locale/en_US/LC_MESSAGES/NR.po (4)

22-22: Language header matches file locale

The Language: field correctly reads en_US, matching the file path.


27-27: Confirm X-Source-Language header

The X-Source-Language is set to en_NR. Verify this is intentional (source messages may be in the en_NR variant). If the original texts are in a different locale (e.g., default English), consider updating this header.


29-32: Observed holiday formatting is correct

The c-format entry for "%s (observed)" is properly defined.


34-92:

✅ Verification successful

Verify translation keys against provider definitions

Ensure every msgid here exactly matches the holiday keys in holidays/countries/nauru.py. You can run:


🏁 Script executed:

#!/bin/bash
set -euo pipefail
# Extract provider keys
rg -oP 'add_\w+\(\s*tr\("([^"]+)"\)' holidays/countries/nauru.py \
  | sed -E 's/.*tr\("([^"]+)"\).*/\1/' | sort > provider_keys.txt
# Extract PO keys
grep -Po '^msgid "\K[^"]+' holidays/locale/en_US/LC_MESSAGES/NR.po \
  | sort > po_keys.txt
# Compare
diff provider_keys.txt po_keys.txt || true

Length of output: 329


I’d like to double-check what holidays are actually defined in holidays/countries/nauru.py around the add_ calls:


🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n 'add_' holidays/countries/nauru.py -A2 -B2

Length of output: 2232


Let’s pull in every tr("…") in nauru.py (not just the single‐line add_* calls) and diff against the PO to catch genuine mismatches:


🏁 Script executed:

#!/bin/bash
set -euo pipefail
# Extract all tr() keys from provider
rg -oP 'tr\("([^"]+)"\)' holidays/countries/nauru.py \
  | sed -E 's/.*tr\("([^"]+)"\).*/\1/' | sort > provider_all_keys.txt
# Extract PO keys
grep -Po '^msgid "\K[^"]+' holidays/locale/en_US/LC_MESSAGES/NR.po \
  | sort > po_keys.txt
# Show differences
diff provider_all_keys.txt po_keys.txt || true

Length of output: 235


All translation keys in NR.po align with Nauru provider definitions

I ran a full diff of every tr("…") key in holidays/countries/nauru.py against the msgid entries in holidays/locale/en_US/LC_MESSAGES/NR.po and found no mismatches. Everything lines up—no further action needed here.

✨ Finishing Touches
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Commit Unit Tests in branch NR
  • 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
codecov bot commented Jun 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (a3eb01d) to head (2d8aea2).
Report is 2 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #2609   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          230       231    +1     
  Lines        14636     14681   +45     
  Branches      2045      2050    +5     
=========================================
+ Hits         14636     14681   +45     

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

@Roshan-1024
Copy link
Contributor Author

Nauru is a small island so there are not many sources about its holidays. The inhabitants speak Nauruan and English (language of government and commerce). Although Nauruan is spoken by almost 96% people, I couldn't find any sources that has holidays mentioned in Nauruan. Also Google translate doesn't support Nauruan.

This states that: "It became a German Colony in the late 19th century but was later administered by Australia". So, I have used en_AU. (Please let me know if that needs to be changed)

@KJhellico @PPsyrius

@KJhellico
Copy link
Collaborator

Public Service Act 1998 (37 - Holidays)
Public Service Act 2016 (Subdivision 10 - Public holidays)
Nauru’s Online Legal Database

@Roshan-1024
Copy link
Contributor Author

Public Service Act 1998 (37 - Holidays)
Public Service Act 2016 (Subdivision 10 - Public holidays)
Nauru’s Online Legal Database

According to Public Service Act 2016, should I implement Independence Day like this:

        # Independence Day.
        name = tr("Independence Day")
        ind_day = date(self._year, 1, 31)
        if ind_day.weekday() == 5:
            self._add_observed(self._add_holiday_feb_2(name))
            self._add_observed(self._add_holiday_feb_3(name))
        elif ind_day.weekday() == 6:
            self._add_observed(self.add_holiday_feb_1(name))
            self._add_observed(self.add_holiday_feb_2(name))
        else:
            self._add_observed(self._add_holiday_jan_31(name)

as it is mentioned that "there is no holiday on the day and instead the following Monday and Tuesday are holidays in the public service" for Independence Day and should I implement similar logic for all the holidays?

And should I remove International Women's Day, RONPhos Handover Day, Ibumin Earoeni Day, Sir Hammer DeRoburt Day (with their references) as these are not mentioned in the official documents?

Also, what should we name the holiday on Feb 1?

@PPsyrius @KJhellico

@KJhellico
Copy link
Collaborator
KJhellico commented Jun 8, 2025
        self._add_observed(
            # Independence Day.
            self._add_holiday_jan_31(tr("Independence Day")),
            rule=SAT_SUN_TO_NEXT_MON_TUE,
        )

        self._add_observed(
            # Day following Independence Day.
            self._add_holiday_feb_1(tr("Day following Independence Day")),
            rule=SAT_SUN_TO_NEXT_MON_TUE,
        )

2024

@KJhellico
Copy link
Collaborator
KJhellico commented Jun 8, 2025

International Women's Day, RONPhos Handover Day, Ibumin Earoeni Day, Sir Hammer DeRoburt Day

Obviously, these holidays were introduced later. Or maybe they are declared annually.

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 5713dee and d6d5a43.

📒 Files selected for processing (4)
  • README.md (2 hunks)
  • holidays/countries/nauru.py (1 hunks)
  • holidays/locale/en_AU/LC_MESSAGES/NR.po (1 hunks)
  • tests/c 8000 ountries/test_nauru.py (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
tests/countries/test_nauru.py (2)
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.
Learnt from: KJhellico
PR: vacanza/holidays#2530
File: tests/countries/test_andorra.py:23-28
Timestamp: 2025-05-06T21:07:11.577Z
Learning: In the holidays project, test methods for country holidays follow a standard form where year ranges are explicitly recreated in each test method rather than being stored as class variables, to maintain consistency across all country tests.
🪛 Pylint (3.3.7)
holidays/countries/nauru.py

[convention] 34-34: Line too long (141/100)

(C0301)


[convention] 38-38: Line too long (187/100)

(C0301)


[convention] 39-39: Line too long (172/100)

(C0301)


[convention] 40-40: Line too long (164/100)

(C0301)


[convention] 41-41: Line too long (164/100)

(C0301)


[convention] 42-42: Line too long (172/100)

(C0301)


[convention] 1-1: Missing module docstring

(C0114)


[convention] 149-149: Missing class docstring

(C0115)


[convention] 153-153: Missing class docstring

(C0115)

tests/countries/test_nauru.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 'TestNauru.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] 47-47: Missing function or method docstring

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)

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

108-108: Documentation update looks good.

The country count increment is accurate and reflects the addition of Nauru support.


969-974: Nauru entry follows the established pattern.

The table entry correctly shows NR code, no subdivisions, en_AU as default language, and no additional categories. This aligns with the implementation and locale choice discussed in the PR.

holidays/locale/en_AU/LC_MESSAGES/NR.po (1)

1-90: Localization file is well-structured.

The .po file contains all necessary holiday entries with proper headers. Empty msgstr entries are correct for en_AU locale since the source text is already in Australian English.

holidays/countries/nauru.py (1)

24-147: Solid implementation following established patterns.

The holiday definitions are comprehensive and use appropriate observance rules. The use of self._add_observed() with proper rules like SAT_SUN_TO_NEXT_MON_TUE for Independence Day and Christmas aligns with the official requirements discussed in the PR.

🧰 Tools
🪛 Pylint (3.3.7)

[convention] 34-34: Line too long (141/100)

(C0301)


[convention] 38-38: Line too long (187/100)

(C0301)


[convention] 39-39: Line too long (172/100)

(C0301)


[convention] 40-40: Line too long (164/100)

(C0301)


[convention] 41-41: Line too long (164/100)

(C0301)


[convention] 42-42: Line too long (172/100)

(C0301)

tests/countries/test_nauru.py (1)

19-341: Comprehensive test suite with excellent coverage.

The tests properly verify all holidays, observance rules, introduction years, aliases, and localization. The structure follows project conventions by testing individual holidays across multiple years. The explicit date testing provides clear verification of observed holiday logic.

🧰 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 'TestNauru.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] 47-47: Missing function or method docstring

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)


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

(C0116)

@Roshan-1024
Copy link
Contributor Author

International Women's Day, RONPhos Handover Day, Ibumin Earoeni Day, Sir Hammer DeRoburt Day

Obviously, these holidays were introduced later. Or maybe they are declared annually.

@KJhellico @PPsyrius
Yes they were introduced later.

However, I see some inconsistencies:

  1. RONPHOS Handover
    When this was introduced in 2018, that time it was celebrated on 2nd July but in 2024 it is celebrated on 1st July.
  2. Sir Hammer DeRoburt Day
    Similarly, when this was introduced in 2021, that time it was celebrated on 27th Sept. but in 2024 it is celebrated on 25th Sept.

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 d6d5a43 and 626d9fe.

📒 Files selected for processing (3)
  • README.md (1 hunks)
  • holidays/countries/__init__.py (1 hunks)
  • holidays/registry.py (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
holidays/countries/__init__.py (1)
holidays/countries/nauru.py (3)
  • Nauru (24-146)
  • NR (149-150)
  • NRU (153-154)
🔇 Additional comments (2)
holidays/countries/__init__.py (1)

137-138: Import looks good and keeps the file alphabetised

Nauru, NR, NRU slot in neatly after Namibia and before Nepal; no naming collisions detected.
Nothing else to flag here.

holidays/registry.py (1)

139-141: Registry entry checks out

Key, class name and ISO-codes are all correct, and the alphabetical ordering is preserved.
All good.

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 2c9f0e6 and 16e55d7.

📒 Files selected for processing (3)
  • README.md (2 hunks)
  • holidays/countries/nauru.py (1 hunks)
  • holidays/locale/en_US/LC_MESSAGES/NR.po (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
holidays/countries/nauru.py (2)
Learnt from: KJhellico
PR: vacanza/holidays#2609
File: holidays/countries/nauru.py:149-154
Timestamp: 2025-06-09T19:50:56.039Z
Learning: In the holidays library project, never suggest adding docstrings for alias classes (like NR, NRU country code aliases that inherit from main country classes). The project deliberately omits docstrings for these simple alias classes.
Learnt from: KJhellico
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:63-70
Timestamp: 2025-03-23T10:11:50.465Z
Learning: In the holidays library, the `SAT_SUN_TO_NEXT_MON_TUE` rule is specifically used for consecutive holidays (like Christmas Day and Boxing Day) to ensure they're observed on separate weekdays (Monday and Tuesday) when they fall on weekends, while `SAT_SUN_TO_NEXT_MON` is used as the default rule for other holidays.
🪛 Pylint (3.3.7)
holidays/countries/nauru.py

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

(C0301)


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

(C0301)


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

(C0301)


[convention] 34-34: Line too long (176/100)

(C0301)


[convention] 35-35: Line too long (172/100)

(C0301)


[convention] 36-36: Line too long (133/100)

(C0301)


[convention] 37-37: Line too long (153/100)

(C0301)


[convention] 38-38: Line too long (134/100)

(C0301)


[convention] 39-39: Line too long (134/100)

(C0301)


[convention] 40-40: Line too long (142/100)

(C0301)


[convention] 1-1: Missing module docstring

(C0114)


[convention] 124-124: Missing class docstring

(C0115)


[convention] 128-128: Missing class docstring

(C0115)

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

106-110: Paragraph update looks good

Country count bumped to 187; change aligns with table entry and previous feedback.

🧰 Tools
🪛 LanguageTool

[typographical] ~110-~110: Consider adding a comma after this introductory phrase.
Context: ...e same used for domain names, and for a subdivision its [ISO 3166-2 code](https://en.wikipe...

(AS_A_NN_COMMA)

holidays/locale/en_US/LC_MESSAGES/NR.po (1)

23-34: Translation catalogue complete and consistent

All message IDs required by nauru.py are present; naming matches code exactly.

Copy link
Collaborator
@PPsyrius PPsyrius left a comment

Choose a reason for hiding this comment

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

All that's left now is link archival 👍

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>
Signed-off-by: Roshan Pradhan <roshanpradhan1024@gmail.com>
PPsyrius
PPsyrius previously approved these changes Jun 14, 2025
Copy link
Collaborator
@PPsyrius PPsyrius 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
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

♻️ Duplicate comments (2)
holidays/countries/nauru.py (2)

47-48: 🧹 Nitpick (assertive)

Consider keeping en_AU in supported_languages

Early discussion mentioned en_AU as a viable locale; removing it may break sample code or documentation written before the final decision.

-    supported_languages = ("en_NR", "en_US")
+    supported_languages = ("en_NR", "en_US", "en_AU")

Up to you—this is a non-breaking, nice-to-have addition.


61-71: 💡 Verification agent

🧩 Analysis chain

Please re-check Monday/Tuesday ordering for the Independence-Day pair

Using SAT_SUN_TO_NEXT_MON_TUE for both 31 Jan and 1 Feb yields
• Saturday-case → Mon = Independence (OK), Tue = Day-after (OK)
• Sunday-case → Mon = Day-after, Tue = Independence (reversed)

If the Public Service Act requires Independence Day to be the first working day (Monday) and the “day following” the second (Tuesday), the current rule set is off by one day whenever 31 Jan is a Sunday.

If the output shows Monday → “Day following …” and Tuesday → “Independence Day (observed)”, the order is inverted.
Adjust the rules (e.g. MON for Independence / MON_TUE for the following day) if necessary.


🏁 Script executed:

#!/bin/bash
# Inspect 2021 where 31 Jan was Sunday.
python - <<'PY'
import holidays, datetime as dt
yr = 2021
for d, n in sorted(holidays.Nauru(years=yr).items()):
    if d.month in (1,2):
        print(d, d.strftime("%A"), n)
PY

Length of output: 174


Re-shift Independence Day to the first working day
Running 2021 through the current rules shows:

2021-01-31 (Sun) Independence Day
2021-02-01 (Mon) Day following Independence Day
2021-02-02 (Tue) Independence Day (observed)

That flips the two when 31 Jan is Sunday. To guarantee Jan 31 always lands on the first working day (Mon) and Feb 1 on the second (Tue), split the rules:

holidays/countries/nauru.py (around lines 61–71):

-        self._add_observed(
-            # Independence Day.
-            self._add_holiday_jan_31(tr("Independence Day")),
-            rule=SAT_SUN_TO_NEXT_MON_TUE,
-        )
+        self._add_observed(
+            # Independence Day – always shift weekend to Monday
+            self._add_holiday_jan_31(tr("Independence Day")),
+            rule=MON,  
+        )

-        self._add_observed(
-            # Day following Independence Day.
-            self._add_holiday_feb_1(tr("Day following Independence Day")),
-            rule=SAT_SUN_TO_NEXT_MON_TUE,
-        )
+        self._add_observed(
+            # Day following – shift weekend→Mon/Tue and bump any Monday collision to Tuesday
+            self._add_holiday_feb_1(tr("Day following Independence Day")),
+            rule=MON_TUE,
+        )

With this change, 2021 becomes
• Mon 2021-02-01: Independence Day (observed)
• Tue 2021-02-02: Day following Independence Day (observed)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7768fbb and 7311d55.

📒 Files selected for processing (1)
  • holidays/countries/nauru.py (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
holidays/countries/nauru.py (2)
Learnt from: KJhellico
PR: vacanza/holidays#2609
File: holidays/countries/nauru.py:149-154
Timestamp: 2025-06-09T19:50:56.039Z
Learning: In the holidays library project, never suggest adding docstrings for alias classes (like NR, NRU country code aliases that inherit from main country classes). The project deliberately omits docstrings for these simple alias classes.
Learnt from: KJhellico
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:63-70
Timestamp: 2025-03-23T10:11:50.465Z
Learning: In the holidays library, the `SAT_SUN_TO_NEXT_MON_TUE` rule is specifically used for consecutive holidays (like Christmas Day and Boxing Day) to ensure they're observed on separate weekdays (Monday and Tuesday) when they fall on weekends, while `SAT_SUN_TO_NEXT_MON` is used as the default rule for other holidays.
🪛 Pylint (3.3.7)
holidays/countries/nauru.py

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

(C0301)


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

(C0301)


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

(C0301)


[convention] 34-34: Line too long (176/100)

(C0301)


[convention] 35-35: Line too long (172/100)

(C0301)


[convention] 36-36: Line too long (176/100)

(C0301)


[convention] 37-37: Line too long (196/100)

(C0301)


[convention] 38-38: Line too long (177/100)

(C0301)


[convention] 39-39: Line too long (177/100)

(C0301)


[convention] 40-40: Line too long (185/100)

(C0301)


[convention] 1-1: Missing module docstring

(C0114)


[convention] 124-124: Missing class docstring

(C0115)


[convention] 128-128: Missing class docstring

(C0115)

🔇 Additional comments (1)
holidays/countries/nauru.py (1)

111-120: Sequence of Christmas holidays may be flipped

Applying SAT_SUN_TO_NEXT_MON_TUE to both 25 Dec and 26 Dec causes 25 Dec (Sunday) ⇒ Tuesday and leaves 26 Dec (Monday) unchanged, giving Monday = 26 Dec, Tuesday = Christmas.
Most jurisdictions (and precedent within this library) expect Monday = Christmas, Tuesday = Day-after.

Please verify Nauru’s practice and, if needed, switch to:

-            rule=SAT_SUN_TO_NEXT_MON_TUE,
+            rule=SAT_SUN_TO_NEXT_MON,

for Christmas Day only, keeping SAT_SUN_TO_NEXT_MON_TUE for the following day.

KJhellico
KJhellico previously approved these changes Jun 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! 👍

@Roshan-1024 Roshan-1024 requested a review from PPsyrius June 14, 2025 15:42
PPsyrius
PPsyrius previously approved these changes Jun 14, 2025
@arkid15r arkid15r dismissed stale reviews from PPsyrius and KJhellico via d963cf5 June 14, 2025 19:01
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

🔭 Outside diff range comments (1)
holidays/locale/en_US/LC_MESSAGES/NR.po (1)

92-93: 🧹 Nitpick (assertive)

Add a trailing newline.

A final newline ensures compatibility with gettext tooling and UNIX conventions.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4dfc5c3 and d963cf5.

📒 Files selected for processing (1)
  • holidays/locale/en_US/LC_MESSAGES/NR.po (1 hunks)

Copy link

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarQube Cloud

@arkid15r arkid15r enabled auto-merge June 14, 2025 19:16
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.

This LGTM, @KJhellico @PPsyrius could you verify and approve?

@Roshan-1024
Copy link
Contributor Author

Should I update branch now?

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.

@arkid15r, good catch! LGTM now.

@arkid15r
Copy link
Collaborator

Should I update branch now?

I believe it's ready for merging.

@arkid15r arkid15r added this pull request to the merge queue Jun 14, 2025
Merged via the queue into vacanza:dev with commit d4e9e31 Jun 14, 2025
32 of 33 checks passed
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.

Add Nauru holidays
4 participants
0