-
-
Couldn't load subscription status.
- Fork 1.2k
[deprecation] setup.cfgand tox.ini sections need to start by 'pylint'
#8465
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| Following a deprecation period, it's now longer possible to use ``MASTER`` | ||
| or ``master`` as configuration section in ini files. It's bad practice | ||
Pierre-Sassoulas marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| to not start sections titles with the tool name. Please use ``pylint.main`` instead. | ||
|
|
||
| Refs #8464 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,6 @@ | |
| import configparser | ||
| import os | ||
| import sys | ||
| import warnings | ||
| from pathlib import Path | ||
| from typing import TYPE_CHECKING | ||
|
|
||
|
|
@@ -41,23 +40,13 @@ def _parse_ini_file(self, file_path: Path) -> tuple[dict[str, str], list[str]]: | |
|
|
||
| config_content: dict[str, str] = {} | ||
| options: list[str] = [] | ||
| ini_file_with_sections = self._ini_file_with_sections(file_path) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's a perf increase here, we calculate the boolean once instead of for each sections 😄 |
||
| for section in parser.sections(): | ||
| if self._ini_file_with_sections(file_path) and not section.startswith( | ||
| "pylint" | ||
| ): | ||
| if section.lower() == "master": | ||
| # TODO: 3.0: Remove deprecated handling of master, only allow 'pylint.' sections | ||
| warnings.warn( | ||
| "The use of 'MASTER' or 'master' as configuration section for pylint " | ||
| "has been deprecated, as it's bad practice to not start sections titles " | ||
| "with the tool name. Please use 'pylint.main' instead.", | ||
| UserWarning, | ||
| ) | ||
| else: | ||
| continue | ||
| for opt, value in parser[section].items(): | ||
| config_content[opt] = value | ||
| options += [f"--{opt}", value] | ||
| if ini_file_with_sections and not section.startswith("pylint"): | ||
| continue | ||
| for option, value in parser[section].items(): | ||
| config_content[option] = value | ||
| options += [f"--{option}", value] | ||
| return config_content, options | ||
|
|
||
| @staticmethod | ||
|
|
||
This file was deleted.
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.