jsh9 / cercis

https://pypi.org/project/cercis/
MIT License
14 stars 1 forks source link

cercis reports "Cannot parse:" on a file containing '''"test"''' #33

Open cmaeder opened 10 months ago

cmaeder commented 10 months ago

cercis replaces triple single quotes with triple double quotes (despite to use single quotes) and then complains about quadruple double quotes.

For example, take this code (a double quoted string within triple single quotes):

'''"test"'''

And run it with these arguments:

$ cercis test.py

The resulting error is (showing quadruple double quotes):

error: cannot format test.py: Cannot parse: 1:11: """"test""""

Expected behavior

no error, as with the option "single-quote = false"

Environment

jsh9 commented 10 months ago

Hi @cmaeder , thanks for raising this issue.

This is indeed a bug of Cercis, but I haven't had time yet to further investigate how to solve it. I'll keep this in mind and maybe get back to it in a few weeks.