Skip to content
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

Respect docstring-min-length in docparams extension #10104

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

berkersal
Copy link

Even though visit_functiondef is checking for docstring-min-length, it is not enough. This commit fixes the issue by adding the same check to visit_raise, visit_return and visit_yield

If there is a better way of implementing this, please go forward. I am just providing a working fix to this problem.

Type of Changes

Type
🐛 Bug fix

Description

Refs #XXXX

Closes #XXXX

@Pierre-Sassoulas Pierre-Sassoulas added the False Negative 🦋 No message is emitted but something is wrong with the code label Dec 2, 2024
Copy link

codecov bot commented Dec 2, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 95.79%. Comparing base (55098c7) to head (acc2d6d).

Files with missing lines Patch % Lines
pylint/extensions/docparams.py 75.00% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #10104      +/-   ##
==========================================
- Coverage   95.80%   95.79%   -0.02%     
==========================================
  Files         174      174              
  Lines       18973    18985      +12     
==========================================
+ Hits        18177    18186       +9     
- Misses        796      799       +3     
Files with missing lines Coverage Δ
pylint/extensions/docparams.py 98.52% <75.00%> (-1.48%) ⬇️

Copy link
Contributor

github-actions bot commented Dec 2, 2024

🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉

This comment was generated for commit acc2d6d

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for opening a PR ! Would you mind adding functional tests (https://github.com/pylint-dev/pylint/tree/main/tests/functional/ext/docparams) and a changelog (https://github.com/pylint-dev/pylint/tree/main/doc/whatsnew/fragments) for this please ?

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good thank you ! Any reasons not to create a reusable function for the new code in the doc param class (copy pasted thrice as far as I understand) ?

@Pierre-Sassoulas
Copy link
Member

Don't mind the fail of the CI this is due to python/cpython#125415 in 3.13.1 we're going to be able to rebase on main once it's fixed.

@berkersal berkersal force-pushed the main branch 4 times, most recently from e25b013 to 2562e1e Compare December 7, 2024 16:01
Even though visit_functiondef is checking for docstring-min-length, it is not enough. This commit fixes the issue by adding the same check to visit_raise, visit_return and visit_yield
@berkersal
Copy link
Author

Sorry for a lot of pushes 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
False Negative 🦋 No message is emitted but something is wrong with the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants