Add Faroe Islands holidays
Proposed change
- Introduced a new holiday provider: Faroe Islands.
- Implemented all official public holidays based on trusted sources.
- Included half-day recognition (e.g., Ólavsøkuaftan).
- Created country aliases: FO and FRO.
Type of change
- [x] 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
holidaysfunctionality in general)
Fixed: #2511
Checklist
- [x] I've followed the contributing guidelines
- [x] I've successfully run
make check, all checks and tests are green
References
https://visitfaroeislands.com/en/plan-your-stay/before-you-arrive-in-the-faroe-islands/public-holidays https://en.wikipedia.org/wiki/Public_holidays_in_the_Faroe_Islands
Summary by CodeRabbit
-
New Features
- Added support for Faroe Islands holidays, including both public and half-day holidays, from 1948 onwards.
- Introduced aliases and country codes for Faroe Islands (FO, FRO).
- Added localizations for Faroe Islands holidays in Faroese, Danish, English (US), Icelandic, Norwegian, and Swedish.
-
Documentation
- Updated the README to include Faroe Islands in the list of supported countries.
-
Tests
- Added comprehensive tests for Faroe Islands holiday calculations and localizations.
-
Chores
- Updated ignore patterns to exclude all
__pycache__directories.
- Updated ignore patterns to exclude all
Summary by CodeRabbit
-
New Features
- Added support for Faroe Islands holidays, including both public and half-day holidays, with coverage from 1948 onward.
- Introduced aliases for Faroe Islands using FO and FRO country codes.
- Faroe Islands holidays are now available in multiple languages: Faroese, Danish, English, Icelandic, Norwegian, and Swedish.
-
Documentation
- Updated the documentation to include Faroe Islands in the list of supported countries and languages.
-
Tests
- Added tests to verify correct holiday names, aliases, and localization for the Faroe Islands.
-
Chores
- Updated configuration to ignore all
__pycache__directories recursively.
- Updated configuration to ignore all
Walkthrough
The changes introduce support for Faroe Islands holidays by adding a new country module, updating the country imports and registry, adding multiple localization files, and providing comprehensive tests. The .gitignore file is also updated to exclude all __pycache__ directories recursively.
Changes
| Files/Paths | Change Summary |
|---|---|
.gitignore |
Added pattern to ignore all __pycache__ directories recursively. |
holidays/countries/__init__.py |
Imported Faroe Islands holiday module and its aliases. |
holidays/countries/faroe_islands.py |
New module defining Faroe Islands holidays, aliases, and localization metadata. |
holidays/registry.py |
Added Faroe Islands entry to the countries registry dictionary. |
holidays/locale/{da,en_US,fo,is,no,sv}/LC_MESSAGES/FO.po |
Added localization files with translations of Faroe Islands holiday names in multiple languages. |
tests/countries/test_faroe_islands.py |
New tests for Faroe Islands holidays, aliases, and localization. |
README.md |
Updated supported countries count and added Faroe Islands entry with supported languages info. |
Assessment against linked issues
| Objective | Addressed | Explanation |
|---|---|---|
| Add Faroe Islands holidays and aliases (2511) | ✅ | |
| Define public and Christian holidays correctly | ✅ | |
| Provide localized holiday names | ✅ | |
| Include tests verifying holidays and localization | ✅ |
Assessment against linked issues: Out-of-scope changes
No out-of-scope changes detected.
Possibly related PRs
- vacanza/holidays#2442: Adds support for French Southern Territories holidays with similar structure and files modified, closely related in approach to adding a new country.
Suggested reviewers
- KJhellico
- PPsyrius
✨ Finishing Touches
- [ ] 📝 Generate Docstrings
🧪 Generate Unit Tests
- [ ] Create PR with Unit Tests
- [ ] 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.
🪧 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
@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai explain this code block.@coderabbitai modularize this function.
- PR comments: Tag
@coderabbitaiin 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 pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai generate docstringsto generate docstrings for this PR.@coderabbitai generate sequence diagramto generate a sequence diagram of the changes in this PR.@coderabbitai auto-generate unit teststo generate unit tests for this PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere 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.
@Shrot101, it's good start, but it needs to be significantly improved. I advise you to look at latest merged PRs as example (#2583, #2582, #2571, #2562), to better understand requirements and standards established in this project.
@Shrot101, it's good start, but it needs to be significantly improved. I advise you to look at latest merged PRs as example (#2583, #2582, #2571, #2562), to better understand requirements and standards established in this project.
Thank you for guiding me. Please tell me how to implement a translation file in the locale folder. Do I have to create it for all the languages "da", "en_US", "fo", "is", "no", "sv".
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 100.00%. Comparing base (
5176c05) to head (82a258c). Report is 12 commits behind head on dev.
Additional details and impacted files
@@ Coverage Diff @@
## dev #2606 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 253 254 +1
Lines 15201 15239 +38
Branches 2095 2095
=========================================
+ Hits 15201 15239 +38
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
Please tell me how to implement a translation file in the locale folder. Do I have to create it for all the languages "da", "en_US", "fo", "is", "no", "sv".
Usual way is run make l10n - it's create .po file for default language. Then use it as a base for other translations.
First of all, you need to merge latest changes from dev and resolve conflicts.
[ ] I've followed the contributing guidelines [ ] I've successfully run make check, all checks and tests are green
These statements are not just a formality here.
First of all, you need to merge latest changes from
devand resolve conflicts.
Yes, just found that. I just started so learning it.
@KJhellico, I updated the code. Please check it. I tried to resolve the issues. If there are any further issues, please guide me. Thank you for guiding me until now. I am learning a lot from this repo and you.
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
Hi @Shrot101 It's been 2 weeks since last update -- any progress/plans on addressing the comments?
Hi @Shrot101 It's been 2 weeks since last update -- any progress/plans on addressing the comments?
I was outside due to some reasons. I will do it till tomorrow.
Not completed by expected date.