-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix parsing of unrelated options in tox.ini #6801
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
Conversation
Pull Request Test Coverage Report for Build 2430451567
💛 - Coveralls |
This comment has been minimized.
This comment has been minimized.
Otherwise, the build warns on Sphinx 5.0.0, and warnings are treated as errors, so the docs build fails.
🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉This comment was generated for commit ad86b16 |
@DanielNoord this looks good on my end (minus some additional linting messages ;-) ) Recap for how I tested in tox:
|
Thanks! That sounds like the right way to test this. It surprises me this hasn't been caught earlier. It is basically the same issue as #4371 which I considered to be quite problematic. Only this time it is not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -31,8 +31,7 @@ def __init__(self, verbose: bool, linter: PyLinter) -> None: | |||
self.verbose_mode = verbose | |||
self.linter = linter | |||
|
|||
@staticmethod | |||
def _parse_ini_file(file_path: Path) -> tuple[dict[str, str], list[str]]: | |||
def _parse_ini_file(self, file_path: Path) -> tuple[dict[str, str], list[str]]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tremor of the removal of no-self-use
😄 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes!
if "setup.cfg" in file_path: | ||
return True | ||
if "tox.ini" in file_path: | ||
return True | ||
return False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if "setup.cfg" in file_path: | |
return True | |
if "tox.ini" in file_path: | |
return True | |
return False | |
return any(n in file_path for n in ["setup.cfg", "tox.ini"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's leave this as is.
I can imagine we want to expand this. For example, by checking if a section starts with tool:pylint
if we are in a setup.cfg
file.
doc/whatsnew/2/2.15/index.rst
(ordoc/whatsnew/2/2.14/full.rst
if the change needs backporting in 2.14). If necessary you can write
details or offer examples on how the new change is supposed to work.
and preferred name in
script/.contributors_aliases.json
Type of Changes
Description
Closes #6800
We were parsing all options in
tox.ini
. Withunrecognised-option
this was now showing up as an error, but the actual fix is to no longer parse all options unless they are under[pylint]
.@aneuway2 would you be able to test this fix?