-
-
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 Pylint Configuration Parsing Bug Causing Incorrect Option Settings #8460 #8591
Closed
Closed
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1e543fa
fixed #8460
ianrose1 973c6a3
Merge branch 'main' of github.com:ianrose1/pylint
ianrose1 70e3835
Fix(pylint): Respect values in .toml configuration files (pylint-dev#β¦
ianrose1 8547a3e
Merge branch 'main' of github.com:ianrose1/pylint
ianrose1 b41541c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 001cdb4
Update 8460.bugfix
ianrose1 e9d7798
Update 8460.bugfix
ianrose1 602c8f4
Merge branch 'main' into main
Pierre-Sassoulas 05c496c
Merge branch 'main' into main
Pierre-Sassoulas File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Fixed issue of specifying options as false on .toml files. | ||
|
||
Refs #8460 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
tests/config/functional/toml/issue_8460/toml_store_true_error.result.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"from_stdin": false, | ||
"exit_zero": false | ||
} |
6 changes: 6 additions & 0 deletions
6
tests/config/functional/toml/issue_8460/toml_store_true_error.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Check to see if we can specify configurations as false | ||
# without pylint treating the presence of the key as enabling that value | ||
|
||
[tool.pylint.main] | ||
from_stdin = false | ||
exit_zero = false |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 we should also check the type of the config option. If somebody put in
false
for a non-store_true
option we don't want to this this. A test for this would also be good!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.
Sounds good! Do you know if there's an efficient way to check the type of config? I was looking at the function "_convert_option_to_argument" in pylint/config/utils.py, but not sure if that would work.
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.
No, although you could perhaps wait with parsing them until you reach:
pylint/pylint/config/arguments_manager.py
Lines 211 to 214 in 4cdf922
This should have knowledge of all registered arguments.