forked from py-pdf/pypdf
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DOC: Use google style docstrings (py-pdf#1534)
The Google Docstring style is way more readable than ReST style docstrings. For this reason, this PR replaces ReST style docstrings by Google Style docstrings. Tools used: - pyment - pydocstyle Other changes: * DEV: Set python_use_unqualified_type_names=True * MAINT: Additionally, most instances of 'pragma: no-cover' were replaced by the more descriptive 'deprecated'. * DOC: Document how to document
- Loading branch information
1 parent
0ba45ea
commit 5c0b11d
Showing
27 changed files
with
1,126 additions
and
489 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Documentation | ||
|
||
## API Reference | ||
|
||
### Method / Function Docstrings | ||
|
||
We use Google-Style Docstrings: | ||
|
||
``` | ||
def example(param1: int, param2: str) -> bool: | ||
""" | ||
Example function with PEP 484 type annotations. | ||
Args: | ||
param1: The first parameter. | ||
param2: The second parameter. | ||
Returns: | ||
The return value. True for success, False otherwise. | ||
Raises: | ||
AttributeError: The ``Raises`` section is a list of all exceptions | ||
that are relevant to the interface. | ||
ValueError: If `param2` is equal to `param1`. | ||
Examples: | ||
Examples should be written in doctest format, and should illustrate how | ||
to use the function. | ||
>>> print([i for i in example_generator(4)]) | ||
[0, 1, 2, 3] | ||
""" | ||
``` | ||
|
||
* The order of sections is (1) Args (2) Returns (3) Raises (4) Examples | ||
* If there is no return value, remove the | ||
* Properties should not have any sections | ||
|
||
|
||
## Issues and PRs | ||
|
||
An issue can be used to discuss what we want to achieve. | ||
|
||
A PR can be used to discuss how we achieve it. | ||
|
||
## Commit Messages | ||
|
||
We want to have descriptive commits in the `main` branch. For this reason, every | ||
pull request (PR) is squashed. That means no matter how many commits a PR has, | ||
in the end only one combined commit will be in `main`. | ||
|
||
The title of the PR will be used as the first line of that combined commit message. | ||
|
||
The first comment within the commit will be used as the message body. | ||
|
||
See [dev intro](intro.html#commit-messages) for more details. |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.