-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Fix PercentLiteralDelimiters auto-correct #1251
Fix PercentLiteralDelimiters auto-correct #1251
Conversation
expression + | ||
closing_newline + closing_delimiter + reg_opt | ||
expression_indentation + expression + closing_newline + | ||
closing_indentation + closing_delimiter + reg_opt |
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.
This feels like a bit too much effort for just replacing two characters in a string. Does anyone have a suggestion on how to improve it? The "problem" is that it is not known exactly which characters should be replaced (they could be any delimiter pair) nor the position of the last character (it could be followed by regular expression modifiers).
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.
Yeah, seem pretty complex (even before your changes). Off the top of my head I can't think of anything better, but perhaps @jonas054 and @yujinakayama have some alternative ideas.
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.
I don't. The code looks quite clear to me, even if it is a bit complex.
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. |
There's a typo in the commit title: PercentLiterDelimiters |
@jonas054 Typo fixed. Thanks for noticing. |
@hannestyden Just noticed there's no changelog entry. |
Make it preserve the indentation of the contained expression.
@bbatsov Changelog entry added. |
…auto-correct-fix Fix PercentLiteralDelimiters auto-correct
👍 |
@bbatsov Thanks! 🙇 |
Make PercentLiteralDelimiters preserve the indentation of the contained expression.