Skip to content
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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

ianrose1
Copy link

@ianrose1 ianrose1 commented Apr 19, 2023

Type of Changes

Type
βœ“ πŸ› Bug fix
✨ New feature
πŸ”¨ Refactoring
πŸ“œ Docs

Description

Refs #8460

Closes #XXXX

@codecov
Copy link

codecov bot commented Apr 19, 2023

Codecov Report

Merging #8591 (05c496c) into main (ee37544) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #8591   +/-   ##
=======================================
  Coverage   95.75%   95.75%           
=======================================
  Files         173      173           
  Lines       18648    18649    +1     
=======================================
+ Hits        17856    17857    +1     
  Misses        792      792           
Files Changed Coverage Ξ”
pylint/config/config_file_parser.py 100.00% <100.00%> (ΓΈ)

@github-actions

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":
Copy link
Collaborator

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!

Copy link
Author

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.

Copy link
Collaborator

@DanielNoord DanielNoord Apr 22, 2023

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:

try:
self.config, parsed_args = self._arg_parser.parse_known_args(
arguments, self.config
)

This should have knowledge of all registered arguments.

@Pierre-Sassoulas Pierre-Sassoulas added the Configuration Related to configuration label Apr 21, 2023
@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.17.3 milestone Apr 21, 2023
@github-actions

This comment has been minimized.

@Pierre-Sassoulas Pierre-Sassoulas modified the milestones: 2.17.3, 2.17.4 Apr 24, 2023
@Pierre-Sassoulas Pierre-Sassoulas modified the milestones: 2.17.4, 2.17.5 May 5, 2023
@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

πŸ€– According to the primer, this change has no effect on the checked open source code. πŸ€–πŸŽ‰

This comment was generated for commit 05c496c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug πŸͺ² Configuration Related to configuration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants