-
-
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
Parameter Documentation checker only works if at least one parameter is documented properly #3799
Comments
@luigibertaco thanks for the report. |
Sure, I think we are on the same page on However, if that is the case, would they activate the |
@luigibertaco thanks for your explanation. |
Hello, I would like to work on that :) Are these the tests for those two messages? |
Hello, glad to hear that, I'll assign the issue to you ! :) The files you linked are the unit test but you can also take example on this to creates new functional tests if you prefer that. |
Should I create separate functional tests for the |
Same file is ok unless the file become 100+ lines big :) |
Hello again, quick question. Will the param doc plugin raise any warnings if there is no parameter documentation? |
Hello, yes : def foobar1(arg1, arg2):
"""function foobar ...
"""
print(arg1, arg2) Should raise at least a warning. As @luigibertaco pointed out, if someone is activating this extension it means they want pylint to check that parameters are defined in the documentation in all cases. I see two possibilities:
I think the second way to do it will prevent us from having to add an option later for those who want to not have incomplete documentation but want to keep a simple docstring possible if not adding the doc make sense (they would just have to disable this new warning). What do you think ? |
Okay yes, |
Yes a single PR would work :) |
Also, when I'm running all the functional tests many of them are failing. Any idea why this happens? I have astroid 2.7.3 |
I think you don't have the latest pylint which should have astroid 2.8.0, you should fetch the main repository and rebase your branch on it.
Then possibly upgrade your dependencies with pip so they're up to date. |
Hello, I have another question. For the |
I think it should check for yields, returns and raises as it's "some doc" Except if it makes the implementation a lot harder then we could rename it to |
I think this is more complex since Also, the default value for the options |
Ho I did not think of that, yes let's change it to Regarding the default value, I guess it's because often you don't want to be super specific about the params (if they're typed and have a great name docstrings params are a little too much imo) but still want to have a one line description of the function. So the default value is forgiving, and if someone really want to document everything they can change the option. I think we should keep it that way. |
Great, so the default values don't change and we change the message to |
I think you might need to run |
An outdated pylint installed in your virtual environment could be it like @DanielNoord said. If you did a |
I am getting this error with |
Can you show the full stack trace? From this error message I can't really determine where this is failing. |
|
I feel this might be due to your |
This fixed it, thank you! |
One last question 😅 I added my changes in ChangeLog and version.rst but the |
Can you post your changes? |
Don't immediately see what's wrong here. Can you post the full error? And are you sure you have installed all dependencies? |
I looked into it but code 9009 means that some file can't be found. This means that something is wrong with one of the file paths. |
Steps to reproduce
pylint.extensions.docparams
Current behavior
The checker doesn't raise any warnings related to the parameters on the documentation
Expected behavior
Something similar to this:
That will return the warnings for any missing parameter:
pylint --version output
The text was updated successfully, but these errors were encountered: