Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't configure .flake8 comma separated value #495

Open
Avasam opened this issue Jul 18, 2022 · 2 comments
Open

Can't configure .flake8 comma separated value #495

Avasam opened this issue Jul 18, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@Avasam
Copy link

Avasam commented Jul 18, 2022

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.

@Avasam Avasam added the bug Something isn't working label Jul 18, 2022
@andreoliwa
Copy link
Owner

But a proper working solution for .flake8 would be nice.

Indeed, I agree. 😅

I hope it's a simple fix, I'll take a look when I have some time.
Thanks for the report. 🙏🏻

@andreoliwa andreoliwa moved this to Upvoted / Requests in Nitpick Roadmap Sep 19, 2022
@Avasam
Copy link
Author

Avasam commented Mar 20, 2023

For what it's worth, I changed from flake8 to Ruff, so this is less of a priority to get nitpick working for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Upvoted / Requests
Development

No branches or pull requests

2 participants