docs: convert Component.add docstring to Google Style#1390
Open
mvanhorn wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Contributes to #1072.
Converts the
Component.adddocstring insrc/icalendar/cal/component.pyfrom reStructuredText:param:/:returns:syntax to Google Style withParameters:,Returns(omitted, returns nothing), and anExample:block. Follows the pattern set by #1316 (string_parameter) and #1309 (caselessdict).The Example block adds a runnable doctest that verifies
Component.addcorrectly stores the value as avText(Team sync→vText(b'Team sync')).Also adds a CHANGES.rst entry under the Documentation section.
Why these changes
The original docstring used
:param name: ... :type name: string :returns: None. The project's style guide now expects Google Style headings and inline type information. This PR is one more step toward the consistent format described in #1072.Verification
python3 -m doctest src/icalendar/cal/component.py(run fromsrc/): the newComponent.addexample block passes. (Three unrelated pre-existing failures inlinks,to_jcal, anduidare about hardcoded UIDs/timestamps and are not touched by this PR.)Documentation preview
The Read the Docs preview will be linked by the bot after this PR is opened. The function shows up at
icalendar.cal.component.Component.add.📚 Documentation preview 📚: https://icalendar--1390.org.readthedocs.build/