Add :pylint: Sphinx role for referencing messages#10904
Open
Br1an67 wants to merge 2 commits intopylint-dev:mainfrom
Open
Add :pylint: Sphinx role for referencing messages#10904Br1an67 wants to merge 2 commits intopylint-dev:mainfrom
Br1an67 wants to merge 2 commits intopylint-dev:mainfrom
Conversation
Add a custom Sphinx role that allows easy referencing of pylint message
documentation. The role automatically determines the message category
and generates appropriate links.
Usage:
:pylint:`used-before-assignment`
This creates a link to the message documentation page at
user_guide/messages/{category}/{message-name}.html.
Closes pylint-dev#10563
for more information, see https://pre-commit.ci
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.
Closes #10563
Type of Changes
Description
This PR adds a custom Sphinx role
:pylint:that allows easy referencing of pylint message documentation throughout the documentation. The role automatically determines the message category (error, warning, convention, refactor, information, or fatal) and generates appropriate links to the message documentation pages.Usage
To reference a pylint message in documentation:
This will create a link to the message documentation page at
user_guide/messages/{category}/{message-name}.html.Implementation Details
doc/exts/pylint_role.pythat implements the custom roledoc/conf.pyFiles Changed
doc/exts/pylint_role.py- New Sphinx extension implementing the:pylint:roledoc/conf.py- Addedpylint_roleto the extensions listdoc/whatsnew/fragments/10563.feature- Changelog entry for the new featureBenefits
This feature makes it easier to reference pylint messages in documentation, especially useful for: