-
Notifications
You must be signed in to change notification settings - Fork 4
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
replace triple-quotes by modifying tokens #144
Conversation
The advantage is that we're actually using `tokenize` to find the position of the triple-quoted strings before replacing the quotes.
@keewis Thanks for the PR! Unfortunately, it looks like it introduced some new issues - but probably related. Apologies that I cannot investigate further, as today is super packed both from work and personal life. The new (or at least newly formatted) error messages:
Please note that this time 5 files are affected, not 11 like with You can reproduce the issue like the following:
or with the appropriate
|
great, thanks a lot for the instructions and the examples. I managed to track down a off-by-one error, which I fixed in the latest commits (and there's actually tests for this so hopefully there won't be any regressions in the future) |
Works like a charm - thanks so much! 🚀 |
This is hopefully much more robust than all of the previous attempts because we're actually extracting just the triple-quoted strings from the reformatted code, and before adding prompts.
TokenError
on second run #142pre-commit run --all-files
changelog.rst