flake8-string-format icon indicating copy to clipboard operation
flake8-string-format copied to clipboard

Double brackets using MW template format

Open xZise opened this issue 10 years ago • 2 comments

The MW uses {{…}} for templates and {{:Bla}} is a valid name which shouldn't be considered a problem. One way to mitigate (at the moment) would be to use {{ :Bla}} because Python doesn't allow { }.format(42).

Another way would be to ignore constellations where there are an even number of brackets on each side as they aren't parsed but its number gets halved.

xZise avatar Sep 08 '15 22:09 xZise

It may be possible to avoid this by adding an option to only check calls which use format, and not to use all strings. Also ca9b86f2 did alleviate that problem a bit as it now only checks fields discovered by Formatter.parse which will automatically exclude {{foo}}.

xZise avatar Sep 10 '15 16:09 xZise

A similar problem occurring in MoinMoin https://bitbucket.org/thomaswaldmann/moin-2.0/src/default/MoinMoin/converter/_tests/test_moinwiki_in.py?fileviewer=file-view-default#test_moinwiki_in.py-272 (which is a pytest project)

jayvdb avatar Oct 19 '15 00:10 jayvdb