Skip to content

Update documentation: surface API for ObservedHolidayBase and NoHolidayBase#3511

Merged
arkid15r merged 7 commits into
vacanza:devfrom
PPsyrius:api_surface
Apr 12, 2026
Merged

Update documentation: surface API for ObservedHolidayBase and NoHolidayBase#3511
arkid15r merged 7 commits into
vacanza:devfrom
PPsyrius:api_surface

Conversation

@PPsyrius

@PPsyrius PPsyrius commented Apr 8, 2026

Copy link
Copy Markdown
Collaborator

Proposed change

  • Improve documentation linkage for existing files
Screenshot 2026-04-08 160251
  • Surface ObservedHolidayBase API file, add/update docstring references for both public and private methods (the latter isn't visible to ReadTheDocs, but a nice QoL change for first-time contributors for sure)
image image image
  • Surface NoHolidayBase to API file, remove HolidayBase base class boilerplate for readability.
    image image

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

@coderabbitai

coderabbitai Bot commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Summary by CodeRabbit

  • Documentation

    • Enhanced documentation with Markdown cross-references and external links throughout guides and API references.
    • Expanded API documentation index with additional module references.
  • Bug Fixes

    • Improved argument initialization handling in base class.
  • Updated API

    • Clarified return type behavior for addition operation to reflect combined holiday instances.

Walkthrough

Docstring and documentation link/formatting updates across docs and library modules; added explicit forwarding __init__ to NoHolidayBase; adjusted HolidayBase.__add__ return annotation; expanded docs-generation replacement mappings and API index entries. No other behavioral changes.

Changes

Cohort / File(s) Summary
Top-level docs
README.md, docs/api.md, docs/examples.md, docs/holiday_categories.md
Replaced plain-text references with Markdown/backticked links; added API index entries for holidays.observed_holiday_base and holidays.no_holiday_base; minor example whitespace/formatting tweaks.
Core docstrings
holidays/holiday_base.py, holidays/ical.py, holidays/utils.py
Rewrote and expanded docstrings with reference-style/backticked links and added RFC/ISO hyperlinks; changed HolidayBase.__add__ return annotation to `HolidayBase
Observed-holiday docs
holidays/observed_holiday_base.py
Added extensive docstrings for ObservedRule, ObservedHolidayBase, and internal observed-date methods — documentation only.
Small behavioral API change
holidays/no_holiday_base.py
Added explicit def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) to forward constructor arguments.
Doc-generation script
scripts/docs/gen_index.py
Expanded FILES_REPLACE_MAPPING to insert backticked display text and additional API reference replacements used when generating docs.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • PPsyrius
  • KJhellico
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main objectives: surfacing API documentation for ObservedHolidayBase and NoHolidayBase, with improved documentation linkage throughout.
Description check ✅ Passed The description clearly outlines the three primary changes: improving documentation linkage, surfacing ObservedHolidayBase API with docstrings, and surfacing NoHolidayBase API with refactored code.
Docstring Coverage ✅ Passed Docstring coverage is 90.91% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecov Bot commented Apr 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (197371a) to head (7fba7b6).
⚠️ Report is 5 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #3511   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          313       313           
  Lines        18687     18689    +2     
  Branches      2389      2389           
=========================================
+ Hits         18687     18689    +2     

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@holidays/holiday_base.py`:
- Around line 396-397: The docstring for HolidayBase.__add__ is inaccurate: for
unsupported operand types the method raises TypeError (except the special-case
when other == 0 where it returns self); update the return/behavior description
in the HolidayBase.__add__ docstring to state that it returns a HolidayBase when
addition succeeds, returns self when other == 0, and raises TypeError for
unsupported operand types so the docs match the implementation.
- Around line 304-305: The __init__ docstring on HolidayBase incorrectly
includes a "Returns" section describing a HolidayBase object; remove the
"Returns" block from the __init__ docstring in class HolidayBase
(holiday_base.py) so the constructor docstring only documents
parameters/behavior (and optionally side effects), leaving return descriptions
out; update the docstring for __init__ to describe input args (e.g.,
country/market) and behavior instead of claiming a returned object.

In `@holidays/ical.py`:
- Around line 231-233: The sentence in the RFC 5545 filename sentence is awkward
and implies the spec governs filenames; replace it with a tighter phrasing such
as: "RFC 5545 does not define filenames for .ics files; follow general
filesystem conventions and avoid problematic characters." Update the sentence in
the docstring/comment in holidays/ical.py where the RFC 5545 filename text
appears so it no longer suggests RFC 5545 specifies filenames and instead
clearly advises following filesystem conventions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: c59fb563-d6b0-4518-ad3a-330739984c5f

📥 Commits

Reviewing files that changed from the base of the PR and between 3ff57eb and 74cbcf5.

📒 Files selected for processing (10)
  • README.md
  • docs/api.md
  • docs/examples.md
  • docs/holiday_categories.md
  • holidays/holiday_base.py
  • holidays/ical.py
  • holidays/no_holiday_base.py
  • holidays/observed_holiday_base.py
  • holidays/utils.py
  • scripts/docs/gen_index.py

Comment thread holidays/holiday_base.py Outdated
Comment thread holidays/holiday_base.py Outdated
Comment thread holidays/ical.py Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
holidays/ical.py (1)

231-233: 🧹 Nitpick | 🔵 Trivial

Simplify the RFC 5545 filename guidance.

The current phrasing ("While...does not explicitly restrict...it is still advisable") is harder to parse than needed. A more direct statement would improve clarity.

✨ Suggested simplification
-        While [RFC 5545](https://datatracker.ietf.org/doc/html/rfc5545) does not explicitly
-        restrict filenames for `.ics` files, it is still advisable to follow general filesystem
-        conventions and avoid problematic characters.
+        [RFC 5545](https://datatracker.ietf.org/doc/html/rfc5545) does not define filename
+        conventions for `.ics` files. Follow general filesystem conventions and avoid
+        problematic characters.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@holidays/ical.py` around lines 231 - 233, The sentence explaining RFC 5545
filename guidance is wordy and hard to parse; replace the current line in
holidays/ical.py with a concise statement such as "RFC 5545 does not restrict
.ics filenames; still follow general filesystem conventions and avoid
problematic characters." Locate the explanatory text block that currently begins
"While RFC 5545 does not explicitly restrict filenames..." and substitute it
with the simplified wording to improve clarity.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@holidays/ical.py`:
- Around line 231-233: The sentence explaining RFC 5545 filename guidance is
wordy and hard to parse; replace the current line in holidays/ical.py with a
concise statement such as "RFC 5545 does not restrict .ics filenames; still
follow general filesystem conventions and avoid problematic characters." Locate
the explanatory text block that currently begins "While RFC 5545 does not
explicitly restrict filenames..." and substitute it with the simplified wording
to improve clarity.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: fa3ca3a0-4941-42ef-bd09-28a262c2bdea

📥 Commits

Reviewing files that changed from the base of the PR and between 74cbcf5 and c596860.

📒 Files selected for processing (2)
  • holidays/holiday_base.py
  • holidays/ical.py

Comment thread holidays/holiday_base.py
@PPsyrius PPsyrius marked this pull request as ready for review April 8, 2026 10:43
@PPsyrius PPsyrius requested a review from arkid15r as a code owner April 8, 2026 10:43
@PPsyrius PPsyrius requested a review from KJhellico April 8, 2026 11:19
KJhellico
KJhellico previously approved these changes Apr 8, 2026

@KJhellico KJhellico left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM! Documentation is something I've always been bad at. 🤷‍♂️

@arkid15r arkid15r left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

Comment thread holidays/holiday_base.py
@arkid15r arkid15r enabled auto-merge April 11, 2026 17:48
@sonarqubecloud

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@README.md`:
- Line 91: The README uses an absolute branch-specific link to HolidayBase
(https://github.com/vacanza/holidays/blob/main/holidays/holiday_base.py);
replace it with a branch/tag-agnostic relative link to the HolidayBase source so
docs remain stable across branches (e.g., use the repository-relative path to
holidays/holiday_base.py or a link that omits "blob/main") and ensure the
textual reference to HolidayBase still points to the same symbol/class name.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: e6b4c999-8026-4c3f-a27f-8c0659f61341

📥 Commits

Reviewing files that changed from the base of the PR and between 723f973 and 7fba7b6.

📒 Files selected for processing (3)
  • README.md
  • docs/holiday_categories.md
  • holidays/holiday_base.py

Comment thread README.md
@arkid15r arkid15r requested a review from KJhellico April 12, 2026 17:48
@arkid15r arkid15r added this pull request to the merge queue Apr 12, 2026
Merged via the queue into vacanza:dev with commit b9372a0 Apr 12, 2026
32 checks passed
@PPsyrius PPsyrius deleted the api_surface branch April 16, 2026 03:22
@KJhellico KJhellico mentioned this pull request Apr 20, 2026
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.

3 participants