Refactor iCal exporter#2977
Conversation
Summary by CodeRabbit
WalkthroughRefactors holidays/ical.py to use a centralized _timedelta helper, adds its import, and precomputes the dates list length for reuse in loops. Updates continuity checks to call _timedelta instead of datetime.timedelta and replaces repeated len() calls with a stored variable. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (1)📚 Learning: 2025-04-03T16:58:27.175ZApplied to files:
🧬 Code graph analysis (1)holidays/ical.py (2)
⏰ Context from checks skipped due to timeout of 300000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (4)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Ruff (0.13.2)holidays/ical.py�[1;31mruff failed�[0m 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. Comment |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #2977 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 301 301
Lines 17962 17964 +2
Branches 2319 2319
=========================================
+ Hits 17962 17964 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
PPsyrius
left a comment
There was a problem hiding this comment.
LGTM 👍
Good catch, not sure how we missed that during the initial PR review, but at least it's fixed now
Proposed change
Speed up date operations by using
_timedeltainstead ofdatetime.timedelta.Type of change
holidaysfunctionality in general)Checklist
make checklocally; all checks and tests passed.