Repository navigation
Rename to flake8 async - #206
Merged
Merged
Conversation
jakkdl
force-pushed
the
rename_to_flake8_async
branch
from
February 23, 2024 16:19
04c0264 to
94810a6
Compare
Zac-HD
reviewed
Feb 23, 2024
Zac-HD
left a comment
Member
There was a problem hiding this comment.
Probably want to rebase on main to get the TRIO117 removal. Overall looks great, and future rounds of review should be quicker with the "Viewed" status set for most files...
| # TRIOxxx_* are fake codes to get different error messages for the same code | ||
| IGNORED_CODES_REGEX = r"TRIO107|TRIO108|TRIO\d\d\d_.*" | ||
| # ASYNCxxx_* are fake codes to get different error messages for the same code | ||
| IGNORED_CODES_REGEX = r"(TRIO|ASYNC)107|(TRIO|ASYNC)108|ASYNC\d\d\d_.*" |
Member
There was a problem hiding this comment.
Suggested change
| IGNORED_CODES_REGEX = r"(TRIO|ASYNC)107|(TRIO|ASYNC)108|ASYNC\d\d\d_.*" | |
| IGNORED_CODES_REGEX = r"(TRIO|ASYNC)10[78]|ASYNC\d\d\d_.+" |
I think this is net easier to read now
Zac-HD
approved these changes
Feb 25, 2024
Zac-HD
left a comment
Member
There was a problem hiding this comment.
LGTM with one nit about a print(), merge when ready 🎉
And after that I'll update the PyPI token, bump version, and release under flake8-async! (and once we've seen everything working smoothly for a while, I'll make a final placeholder/depender release under flake8-trio)
| # TRIOxxx_* are fake codes to get different error messages for the same code | ||
| IGNORED_CODES_REGEX = r"TRIO107|TRIO108|TRIO117|TRIO\d\d\d_.*" | ||
| # ASYNCxxx_* are fake codes to get different error messages for the same code | ||
| IGNORED_CODES_REGEX = r"(TRIO|ASYNC)(107|108|117)|ASYNC\d\d\d_.*" |
| for error_msg in re.findall(r"TRIO\d\d\d", line): | ||
| documented_errors[filename].add(error_msg) | ||
| for error_msg in re.findall(r"TRIO\d\d\d|ASYNC\d\d\d", line): | ||
| print(error_msg, rename_trio_to_async(error_msg)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First steps in renaming the project:
In the second commit I rename all the error codes.
This was largely done with a search&replace of TRIO->ASYNC across all files, and then cleaning up the mess.
_anyio/_triois to generate different suggestion depending on which library you're using.)re.match, to avoid the magic number.Third commit renames Flake8TrioVisitor to Flake8AsyncVisitor
Review the commits separately to maybe retain some sanity. I think the tests should be thorough enough to pick up anything problematic though, so don't think we have to review this super thoroughly.
Remaining steps:
flake8_triodirectory, theflake8_trio/visitors/flake8triovisitor.pyfile, and thetests/test_flake8_trio.pyfile.