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
Lint blib2to3 #3363
base: main
Are you sure you want to change the base?
Lint blib2to3 #3363
Conversation
|
Not a full review (and I know this is still a draft), but please try to keep unnecessary changes to a minimum to reduce churn. |
For sure, small PRs are always my goal. So far, everything is needed to make things pass. Is there something you think is so far out of bounds? |
|
I have to say that adding linting to blib2to3 has raised some pretty egregious code. I think it's worth splitting some of the changes to another PR. So this PR would be adding linting to that dir and maybe fixing just some minor flake8 failures, but anything that requires serious fixing I can add noqa to that line and open separate PRs to remove the noqas so we can discuss the code changes. |
|
The PR seems fine, but I'm not a big fan of the |
Let me give you an example that hopefully convinces you. The original import is any code such as this has a So modifying the import is absolutely necessary, though other options could be renaming the variable names instead of the import, changing |
Description
The goal of this PR is to get files under blib2to3 to be linted during pre-commit. Unfortunately, many of these files have difficult to manage code so to make this PR manageable to review, I've decided to fix some of the flake8 errors while adding
noqato others.As an example of why I added
noqato some, there are some flake8 linting errors forsrc/blib2to3/pgen2/tokenize.py: generate_tokens, which indicate that a rehaul of this function is really necessary.Checklist - did you ...
CHANGES.mdif necessary? is this necessary for internal change?References #3355