-
-
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
Fix empty no_docstring_rgx
not working correctly
#5084
Conversation
no_docstring_rgx
Pull Request Test Coverage Report for Build 1281877563
💛 - Coveralls |
0fbb10f
to
ca9a197
Compare
❯ pip install -e .
Obtaining file:///Users/daniel/DocumentenLaptop/Programming/Github/pylint
Requirement already satisfied: platformdirs>=2.2.0 in /Users/daniel/.pyenv/versions/3.9.6/envs/pylint-3.9.6/lib/python3.9/site-packages (from pylint==2.11.2.dev0) (2.2.0)
Requirement already satisfied: astroid<2.9,>=2.8.0 in /Users/daniel/DocumentenLaptop/Programming/Github/astroid (from pylint==2.11.2.dev0) (2.8.0)
Requirement already satisfied: isort<6,>=4.2.5 in /Users/daniel/.pyenv/versions/3.9.6/envs/pylint-3.9.6/lib/python3.9/site-packages (from pylint==2.11.2.dev0) (5.9.3)
Requirement already satisfied: mccabe<0.7,>=0.6 in /Users/daniel/.pyenv/versions/3.9.6/envs/pylint-3.9.6/lib/python3.9/site-packages (from pylint==2.11.2.dev0) (0.6.1)
Requirement already satisfied: toml>=0.9.2 in /Users/daniel/.pyenv/versions/3.9.6/envs/pylint-3.9.6/lib/python3.9/site-packages (from pylint==2.11.2.dev0) (0.10.2)
Requirement already satisfied: typing-extensions>=3.10.0 in /Users/daniel/.pyenv/versions/3.9.6/envs/pylint-3.9.6/lib/python3.9/site-packages (from pylint==2.11.2.dev0) (3.10.0.0)
Requirement already satisfied: lazy_object_proxy>=1.4.0 in /Users/daniel/.pyenv/versions/3.9.6/envs/pylint-3.9.6/lib/python3.9/site-packages (from astroid<2.9,>=2.8.0->pylint==2.11.2.dev0) (1.6.0)
Requirement already satisfied: wrapt<1.13,>=1.11 in /Users/daniel/.pyenv/versions/3.9.6/envs/pylint-3.9.6/lib/python3.9/site-packages (from astroid<2.9,>=2.8.0->pylint==2.11.2.dev0) (1.12.1)
Requirement already satisfied: setuptools>=20.0 in /Users/daniel/.pyenv/versions/3.9.6/envs/pylint-3.9.6/lib/python3.9/site-packages (from astroid<2.9,>=2.8.0->pylint==2.11.2.dev0) (56.0.0)
Installing collected packages: pylint
Attempting uninstall: pylint
Found existing installation: pylint 2.11.2.dev0
Uninstalling pylint-2.11.2.dev0:
Successfully uninstalled pylint-2.11.2.dev0
Running setup.py develop for pylint
Successfully installed pylint-2.11.2.dev0
WARNING: You are using pip version 21.2.2; however, version 21.2.4 is available.
You should consider upgrading via the '/Users/daniel/.pyenv/versions/3.9.6/envs/pylint-3.9.6/bin/python3.9 -m pip install --upgrade pip' command.
❯ pylint '/Users/daniel/DocumentenLaptop/Programming/Github/pylint/pylint/utils/utils.py'
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00) Not sure what |
no_docstring_rgx
no_docstring_rgx
not working correctly
I wonder why the default value for I would like confirmation on changing this default value before adding a commit that fixes the tests that fail because of the change. Furthermore, it seems like the unittests are really prone to incorrectly testing settings. The change to Edit: I can't reopen this because of force-pushing the branch. Opening a new PR. |
doc/whatsnew/<current release.rst>
.Type of Changes
Description
Turns out we did not handle empty regex options correctly. The referenced issue was broken because whenever the
no_docstring_rgx
option was empty it would try to matchre.compile("")
which always matched and would thus never check a parameter.The change to
get_global_option()
is necessary for it to actually return aPattern[str]
for those options. A problem I couldn't solve was that it is impossible (I think) to tellmypy
that the option belongs toGLOBAL_OPTION_PATTERN
and should therefore return aPattern[str]
. This is because you can't useisinstance
onLiteral
and there is no good solution to do this any other way (usingcast
also doesn't work)./CC @cdce8p Because you helped with #4978 and might have a solution for the
mypy
issue that I don't know about 😄Closes #4136