edaniszewski / pylint-quotes

Pylint plugin for checking the consistency of string quotes
MIT License
41 stars 12 forks source link

Improperly flags invalid-string-quote when embedding quotes in string #21

Closed marcoceppi closed 4 years ago

marcoceppi commented 4 years ago

When producing a string like:

var = "'quoted text' should be 'singled'"

I get the follwoing

Invalid string quote ", should be ' (invalid-string-quote)

Error

edaniszewski commented 4 years ago

@marcoceppi What configuration were you running with? This sounds right to me as a default behavior where the checker is strict. You could try configuring with single-quote=single-avoid-escape which should loosen the constraints when there are embedded quotes. I think that may fix this error

marcoceppi commented 4 years ago

That seems to help, thanks!

edaniszewski commented 4 years ago

I'll update docs to make this more clear -- thanks for opening the issue (: