Fix and improve docstring documentation#601
Open
llucax wants to merge 10 commits into
Open
Conversation
Add `relative_crossrefs: true` to the mkdocstrings Python handler options to support relative cross-references in docstrings. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Add `check-style-mismatch = true` and `require-inline-class-var-docs = true`, and re-enable `check-class-attributes = true`. `check-class-attributes` was previously disabled (in pydoclint 0.5.3) because the project documents class attributes with inline docstrings rather than an `Attributes:` section. The new `require-inline-class-var-docs` option enforces exactly that inline style, so the check is now useful again instead of conflicting with the project's conventions. The source tree already complies, so no docstrings need to change for these checks to pass. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Correct several misspellings and an incorrect config section name (`tools.pytest` -> `tool.pytest`, `mkdocs-literary-nav` -> `mkdocs-literate-nav`) found across the source docstrings. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Fix several grammatical mistakes, missing words, unbalanced backticks and parentheses, and a copy-pasted summary in `generate_protobuf_api_pages()` that incorrectly described Python modules instead of protobuf files. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Boolean-returning functions should start their summary with "Return whether ..." per the docstring conventions, instead of "Tell whether" or "Check if". Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Turn bare backticked mentions of public symbols (classes, functions and module-level variables) into proper cross-references so they render as links. Also de-link a few macro variable names (`version`, `version_requirement`, `code_annotation_marker`) that used link syntax but are not Python symbols, to avoid mis-resolved references. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Convert absolute cross-references to relative ones where the target is the same module, a sibling, or a member of the current package, following the `relative_crossrefs` convention being rolled out. This also shortens the rendered link text in the user guide (e.g. `nox` instead of `frequenz.repo.config.nox`). Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Use the conventional summary mood: a noun phrase starting with "A" for classes and "The" for attributes. Also fix an inaccurate `__init__` summary (it does not initialize environment variables) and add a missing inline docstring for a public class attribute. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Add a missing closing parenthesis in the `flatten()` example and an explicit `import pathlib` to the `existing_paths()` example so the snippets are syntactically valid and self-contained. Also replace some `Example:` admonitions with an `Examples:` section, otherwise they are not shown as code. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
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.
🤖 This pull request is part of an automated effort to improve the docstring documentation of all our projects.
Main issues being resolved:
Other things to note: