-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Rename to flake8 async #206
Conversation
04c0264
to
94810a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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...
tests/test_messages_documented.py
Outdated
# 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_.*" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_.*" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much nicer than my proposal 👍
tests/test_messages_documented.py
Outdated
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)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stray print()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, removed.
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
/_trio
is 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_trio
directory, theflake8_trio/visitors/flake8triovisitor.py
file, and thetests/test_flake8_trio.py
file.