python-syntax
python-syntax copied to clipboard
Require format strings to use .format
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:
After:
cc @nfnty
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(
.