docs(alarm): consolidate parameters and docs of Alarm factory methods - #1603
docs(alarm): consolidate parameters and docs of Alarm factory methods#1603Solaris-star wants to merge 1 commit into
Conversation
|
This pull request did not pass quality checks and AI use is suspected. Please review Contribute and make any necessary amendments. |
|
Profile summary: Full profile |
|
I trimmed the pull request description to fit the PR quality thresholds (under 1000 characters, no inline code references). The AI use is disclosed in the commit message and in the change log entry, per the Responsible AI use policy. |
@Solaris-star FYI, this limit is now 1500 characters, per #1604. Thanks for pointing it out. |
stevepiercy
left a comment
There was a problem hiding this comment.
I'm not sure whether all parameters should be sorted. What do you think? @Solaris-star @niccokunzmann
I also flagged versionadded and added them to #1595 when this gets released.
| description: str, | ||
| trigger: timedelta | datetime, |
There was a problem hiding this comment.
Should these two parameters be sorted as well?
|
|
||
| Conforms to :rfc:`5545#section-3.6.6`. | ||
|
|
||
| .. versionadded:: 7.3.0 |
There was a problem hiding this comment.
Flagging this for the release manager to check that its version number is correct upon release. See #1595
| description: The text to display when the alarm fires. | ||
| Corresponds to the :attr:`description` property. | ||
| trigger: When the alarm fires, as a :class:`~datetime.timedelta` | ||
| relative to the event start (negative means before) or as an | ||
| absolute :class:`~datetime.datetime` (recommend UTC-aware). |
| trigger: timedelta | datetime, | ||
| attach: str | bytes | None = None, |
|
|
||
| Conforms to :rfc:`5545#section-3.6.6`. | ||
|
|
||
| .. versionadded:: 7.3.0 |
| @@ -497,16 +501,16 @@ | |||
| sound file, or :class:`bytes` for inline binary audio data | |||
| (stored as ``VALUE=BINARY``). When ``None`` the client uses | |||
| its default sound. | |||
| summary: str, | ||
| description: str, | ||
| trigger: timedelta | datetime, |
|
|
||
| Conforms to :rfc:`5545#section-3.6.6`. | ||
|
|
||
| .. versionadded:: 7.3.0 |
| @@ -588,16 +594,16 @@ | |||
| required. | |||
| attachments: Optional URI or sequence of URIs to attach to the | |||
| email. | |||
28f2baa to
2cf08ab
Compare
`Alarm.new_display()`, `Alarm.new_audio()` and `Alarm.new_email()` were added in collective#1417, but their optional parameters and `Parameters` entries did not follow the alphabetical order that `Alarm.new()` establishes, and none of them carried a `versionadded` admonition. - Order the optional parameters of the three factory methods alphabetically, matching `Alarm.new()`. The required positional parameters keep their existing order, so no call site breaks. - Order the `Parameters` entries in the docstrings the same way. - Add a `.. versionadded:: 7.3.0` admonition to each factory method, which was overlooked in collective#1417. - Add tests that assert the optional parameters of all four factory methods are in alphabetical order, and that `links`, `related_to`, `refids`, `concepts` and `uid` are forwarded to `Alarm.new()`. The three factory methods are not part of any released tag yet, so reordering their keyword parameters is not a breaking change. Fixes collective#1591 AI disclosure: I used Claude Opus 4.5 to help draft this change and its tests. Prompt: work on collective/icalendar issue collective#1591, verify which of its checklist items are actually still open on current main, align the optional parameters and docstring `Parameters` order of the three Alarm factory methods with `Alarm.new()`, add the missing `versionadded` admonitions, and add tests that fail before the change. Output: this commit. I reviewed the result, confirmed the new tests fail on unpatched main and pass with the change, and validated it locally with the full pytest suite (17837 passed), `pytest src/icalendar/tests/test_with_doctest.py` (368 passed) and `ruff check` / `ruff format`.
2cf08ab to
4e47b9a
Compare
Linked issue
Description
Aligns the three Alarm factory methods with Alarm.new(), following the issue checklist: optional parameters and their docstring Parameters entries are now alphabetical, and each method gained a versionadded admonition for 7.3.0, which was overlooked in #1417.
Required parameters keep their names and positions, and these methods are not in a released tag yet, so no call sites break.
New tests cover attribute forwarding through every factory and assert the optional parameters stay alphabetical. The order test fails on main and passes here.
Ran the full test suite, the doctest suite, and ruff locally.
Checklist