The trailing comma issue you linked is different, but it's good to know that can be detected as well!
What I'd like to prevent is lists that look like
Which python interprets as
In my experience ['A' 'B'] is a typo - ['A', 'B'] was intended.
I discovered that the python AST module discards this kind of information - by the time the AST gets to flake8 it's impossible to tell there was ever implicit string concatenation, so there's nothing flake8 can do about this to my knowledge.
If anybody is interested, here's a rough implementation as a standalone script that uses redbaron: https://github.com/razzius/redbaron-missing-comma-string-collection
On Sun, Jul 23, 2017 at 2:13 PM, Razzi Abuissa <email@example.com> wrote:Hi Razzi,
> Hi PyCQA,
> I've done a little searching but have not found a lint check for the
> evaluates to ['a', 'bc'] due to implicit string concatenation, but usually
> it's intended to be ['a', 'b', 'c']. If it is meant to be ['a', 'bc'] it's
> bad style.
> Guido recommends popular lint tools add a rule for this here:
> If this check does not exist, I would be willing to create a flake8 plugin
> and add it to PyCQA.
This has been discussed here
estyle/issues/308and there are a few
plugins for Flake8 which do this:
You can find Flake8 plugins using this search on PyPI: