-
-
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
Mix incorrect parsing of multi-line options in ini
files
#6944
Conversation
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.
I think this king of option is impossible to test with the config functional test framework.
@@ -0,0 +1,6 @@ | |||
# Reported in https://github.com/PyCQA/pylint/issues/6888 |
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.
Shouldn't the result.json change ? Probably not as init_hook are treated as a special case before the config is instanced, so we should probably create a unit test with multiple print so we can actually check that the code of each line was executed.
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.
This raises a SyntaxError
and fails the test without the changes in the PR. So it is actually a test against the reported issue: multi-line init hooks became syntactically incorrect code.
🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉 This comment was generated for commit 55e8a35 |
Pull Request Test Coverage Report for Build 2489188691
💛 - Coveralls |
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 #6888.
We could also use an
if
statement to check whether the option isinit-hook
and and then not strip the newlines. But that introduce additional overhead, while this makes pylint faster. The fact that the rest of the test suite passes makes me think that this will be fine. We strip most options of whitespaces in other places anyway.If this regresses after
2.14.2
we can simply add theif
statement as desired.