-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Provide an auto-upgrade option / migration tool for pylint configurations #5462
Comments
#5465 mentions two examples that could be fixed by the above command. Definitely worth including these terminology updates as part of the |
The auto-upgrade should remove pylint messages that do not exists anymore, or that can't be raised for interpreter below |
The command that generate the toml config is doing that based on the current configuration. So we have a basis to improve upon. It's also going to need to have some tests before being deployed, and some specification after that to provide in-place upgrade. |
Required for breaking changes like #6870. I'm going to start slow and build on it. |
Don't forget to integrate this in |
We do some pre-processing in
I've done the code to add 'upgrade' (could open a draft MR if it would help), the better default message is possible to make better right now though. Consider the following code with a single subparser; import argparse
def parse_args():
parser = argparse.ArgumentParser(prog='PROG')
parser.add_argument('--foo', action='store_true', help='foo help')
subparsers = parser.add_subparsers(help='sub-command help')
parser_a = subparsers.add_parser('a', help='a help')
parser_a.add_argument('bar', type=int, help='bar help')
# parser_b = subparsers.add_parser('b', help='b help')
# parser_b.add_argument('--baz', choices='XYZ', help='baz help')
parser.parse_args()
if __name__ == "__main__":
parse_args() This is the result when we use
But pylint config currently has this help:
I don't think we need to bother with this if we can decouple pylint-config from the pre-processing step though. I feel this would make our live easier (and the live of future contributors too). |
We do need the pre-processing to make sure the current config is valid, which we probably want to take into account when we are upgrading.
I'm not sure we can... It feels like the |
This will permit to parse config file without having to instantiate a linter for tool working on pylint configuration like #5462
This will permit to parse config file without having to instantiate a linter for tool working on pylint configuration like #5462
This will permit to parse config file without having to instantiate a linter for tool working on pylint configuration like #5462
After discussion on discord with @jacobtylerwalls the design could be :
|
@Pierre-Sassoulas would you be alright with no longer considering this a release blocker? I don't think we should commit to a timeline if we don't have a PR. |
Right, let's make this a blocker for 3.0.0 instead and add a note in the release note for 3.0.0a7 about this. (the stable doc PR took more time than I thought) |
In order to be able to automate the fix later in pylint-dev#5462
In order to be able to automate the fix later in pylint-dev#5462
) In order to be able to automate the fix later in #5462
Current problem
There are breaking changes that could impact the configuration file and make our live as maintainer easier. Asking the user to upgrade their configuration files make most breaking chance impossible. I we can upgrade the configuration file automatically it's easier to make the configuration consistent and easier to maintain. For example a migration to pyproject.toml only instead of maintaining setup.cfg, pylintrc (ini) and pyrpoejct.toml.
Desired solution
New subcommand
pylint --auto-upgrade-conf
to upgrade the configuration file.Additional context
#4741 (comment)
The new framework for configuration file would help to implement this greatly, we would add an auto-upgraded expected result.
The text was updated successfully, but these errors were encountered: