-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pylint.extensions.docparams default options are not working correctly #5223
Comments
Would you be able to share the code that is creating these warnings? For future reference. Default values seem to be correct: Tests also seem fine on first inspection: |
@DanielNoord sure, it's happening for every single one of my functions/methods. Here is an example: def format_dataset(dataset_ref: bigquery.DatasetReference) -> str:
"""Return a BQ SQL-compatible <project>.<dataset> representation of the BQ dataset reference.
:param dataset_ref: the BQ dataset reference to format
"""
return f"{dataset_ref.project}.{dataset_ref.dataset_id}" pylint -d C0301 bqtemplatemanager/
************* Module bqtemplatemanager.helpers
bqtemplatemanager/helpers.py:11:0: W9011: Missing return documentation (missing-return-doc) |
@Pierre-Sassoulas This behaviour seems by design.
Note that both work with Thus, whenever some part of the docstring is correct we no longer check the I have tried removing |
Thanks for looking into it. I think it is contradictory for this to be by design though because then these settings are completely meaningless. Note the wordings of the settings, e.g. "Whether to accept totally missing raises documentation in the docstring of a function that raises an exception." If the check only correctly happens when there is no docstring (or no correct bits within the docstring), then what's the point of the option? If you are to update the documentation to explain the currently implemented behaviour, you are going to have to change the wording to be less about accepting specific scenarios and more about describing when to warn on an absent docstring fullstop. |
@Pierre-Sassoulas Pinging you again because I think you might have missed this. If you just didn't have time to look at this, please consider this message unsent! |
It look like the original intent in #914 was to permit to disable part of the check, so I guess it's a (somewhat solidified with tests since ?) bug and we should update the code, and tests. |
Bug description
The documentation for pylint.extensions.docparams describes that by default,
accept-no-yields-doc
andaccept-no-return-doc
are yes (along with other configuration options).However, if I run
pylint myfile.py
with no pylint configuration except for enabling the plugin*, I see lots of entries of:* my only configuration is:
In all situations, I am deliberately excluding :yields: and :rtype: from the docstring because I am using type annotations.
Am I missing something or is the documented behaviour wrong?
Pylint version
OS / Environment
Debian Buster
The text was updated successfully, but these errors were encountered: