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
base: main
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #8591 +/- ##
=======================================
Coverage 95.75% 95.75%
=======================================
Files 173 173
Lines 18648 18649 +1
=======================================
+ Hits 17856 17857 +1
Misses 792 792
|
This comment has been minimized.
This comment has been minimized.
@@ -79,7 +79,8 @@ def _parse_toml_file(self, file_path: Path) -> tuple[dict[str, str], list[str]]: | |||
for config, value in values.items(): | |||
value = _parse_rich_type_value(value) | |||
config_content[config] = value | |||
options += [f"--{config}", value] | |||
if value.lower() != "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.
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
try: | |
self.config, parsed_args = self._arg_parser.parse_known_args( | |
arguments, self.config | |
) |
This should have knowledge of all registered arguments.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
π€ According to the primer, this change has no effect on the checked open source code. π€π This comment was generated for commit 05c496c |
Type of Changes
Description
Refs #8460
Closes #XXXX