flake8-quotes
flake8-quotes copied to clipboard
strings on multiple lines with different quotes
I'm really keen to use this on pydantic, however there's one ~~blocking~~ issue
Take the following example:
raise ConfigError(
"validators should be used with fields and keyword arguments, not bare. "
"E.g. usage should be `@validator('<field_name>', ...)`"
)
I would say both lines should use double quotes so they're the same even though only one line includes single quotes.
I'm aware this would make analysis more complicated, but is it something you would consider? Either as default or via an option.
not a big worry if this isn't possible since I can use # noqa: Q000
in the few places where this happens.
I think we're open to supporting this but I concur it will add a layer of complexity to everything. One other option aside from noqa
is to use escaping of the quotes to keep everything consistent:
'validators should be used with fields and keyword arguments, not bare. '
'E.g. usage should be `@validator(\'<field_name>\', ...)`'
That being said, I'll leave this issue open as "help wanted" if anyone wants to explore it. Maybe we could call the option adjacent_line_quotes = False (default)/True
I would also be interested in this feature/option
Also interested in this feature
I'd like it too, but it needs to allow the quotes to differ if doing so avoids escapes. e.g.
raise ConfigError(
'validators should be used with "fields" and "keyword" arguments, not bare. '
"E.g. usage should be `@validator('<field_name>', ...)`"
)
should not be an error.