csachs / pyproject-flake8

pyproject-flake8 (pflake8), a monkey patching wrapper to connect flake8 with pyproject.toml configuration
The Unlicense
174 stars 16 forks source link

Use TOML lists rather than comma separated strings #10

Closed johnthagen closed 2 years ago

johnthagen commented 2 years ago

For a tag such as extend-ignore, a more natural TOML API for the user would be that instead of:

extend-ignore = "E203,E204"

Would be:

extend-ignore = ["E203", "E204"]

Behind the scenes, pyproject-flake8 could add commas as needed as it calls out to flake8, but I think it would be cleanest if this was hidden from the user.

This is also more closely to what an actual TOML implementation would look like for flake8.

d-k-bo commented 2 years ago

As far as I can tell, using arrays (lists) like in your example works fine. However, using a table (dict) for per-file-ignores doesn't work in my case. So instead of

[tool.flake8.per-file-ignores]
"tests/*" = ["D", "ANN"]
"noxfile.py" = ["D", "ANN"]

I have to write

[tool.flake8]
per-file-ignores = ["tests/*: D, ANN", "noxfile.py: D, ANN"]
johnthagen commented 2 years ago

As far as I can tell, using arrays (lists) like in your example works fine

Huh, interesting. Perhaps the README should be updated if this is an intentional feature?

johnthagen commented 2 years ago

I tested multiple configuration settings and TOML lists do in fact work.