Skip to content

Can't configure .flake8 comma separated value #495

@Avasam

Description

@Avasam

Expected behavior

Use CSV for .flake8
ie: ignore-names=closeEvent,paintEvent,keyPressEvent,mousePressEvent,mouseMoveEvent,mouseReleaseEvent

Current behavior

ignore-names=["closeEvent", "paintEvent", "keyPressEvent", "mousePressEvent", "mouseMoveEvent", "mouseReleaseEvent"]
or an error if I try to configure nitpick.files.".flake8"

https://github.com/Avasam/nitpick.styles/blob/main/python.toml:1: NIP001  has an incorrect style. Invalid config:
nitpick.files.".flake8": Unknown file. See https://nitpick.rtfd.io/en/latest/nitpick_section.html#nitpick-files.
Violations: ❌ 1 to change manually.

Steps to reproduce

# This throws an error when running `nitpick check`
[nitpick.files.".flake8"]
comma_separated_values = ["flake8.ignore-names"]

[".flake8".flake8]
# PyQt methods
ignore-names = ["closeEvent", "paintEvent", "keyPressEvent", "mousePressEvent", "mouseMoveEvent", "mouseReleaseEvent"]
  1. Configure nitpick TOML style as above
  2. Run nitpick check

Possible Solution

Temporary workaround: I could use strings instead in the toml config, but then I lose the ability to have partial lists (where the user of my nitpick style could add more to ignore-names), as well as multiline configs.

I could just switch to Flake9 or FlakeHeaven to support TOML config given that Flake8's config files are a mess in the first place 😝
But a proper working solution for .flake8 would be nice.

Context

I'm trying to enforce the following config in .flake8:

[flake8]
ignore-names=closeEvent,paintEvent,keyPressEvent,mousePressEvent,mouseMoveEvent,mouseReleaseEvent

Your environment

For more information, see the CONTRIBUTING guide.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    Status

    Upvoted / Requests

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions