Skip to content
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

Require format strings to use .format #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Lilja
Copy link

@Lilja Lilja commented May 5, 2020

First stab at #65. Defines a new root level matcher, pythonStringFormat. The name of this matcher I hope should resemble a string with an accompanying .format-function. Naming is a bit tricky since pythonFormat and pythonStrFormat are both taken.

This matcher tries to do a positive lookahead of .format if there are also strings begining with with ' or ".

No python 2 support. Personally I don't feel it's worth to add it, but if I can be persuaded to do so 😄

Before:
bild

After:
bild

@Lilja
Copy link
Author

Lilja commented May 5, 2020

cc @nfnty

@nfnty
Copy link
Member

nfnty commented Dec 2, 2020

I'd love for this functionality, but as it currently stands it's just not working correctly. If you want to tinker with this look for pythonString and try to implement a similar but custom syn-region but only for strings ending with .format(.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants