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

flake8 support #34

Closed
gaborbernat opened this issue Oct 4, 2020 · 4 comments
Closed

flake8 support #34

gaborbernat opened this issue Oct 4, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@gaborbernat
Copy link
Member

Add support for formatting flake8 sections.

@jugmac00
Copy link
Member

jugmac00 commented Oct 4, 2020

All possible options for flake8: 🙈
https://flake8.pycqa.org/en/latest/user/options.html

@gaborbernat
Copy link
Member Author

We don't have to support all out of box 🤔 maybe a few common ones just first and iterate on it.

@jugmac00
Copy link
Member

jugmac00 commented Oct 6, 2020

I gave this a shot and it kinda works, but once again there is this "comment" topic.

While #42 is about deleted comments, when parsing one of my production tox.ini files with a flake8 section I encountered the problem of inline comments. Allowed or not ( tox-dev/tox#50 ), they work for third party tools.

[flake8]
ignore =
    W504, # line break after binary operator
quiet = 1

Whereas the comment in theConfigParser._read function says inline comments get stripped, this one does not:
https://github.com/python/cpython/blob/96a60ae90c291d94c058c80351fa38b6d73eda92/Lib/configparser.py#L567

(Update -> we do not set an inline-comment-prefix and so it defaults to None)

(Pdb++) parser[section_name]
<Section: flake8>
(Pdb++) parser[section_name].items()
ItemsView(<Section: flake8>)
(Pdb++) list(parser[section_name].items())
[('ignore', '\nW504, # line break after binary operator')]

So, before going down the rabbithole and debugging ConfigParser itself...

What's your take on the whole comment story?

@gaborbernat gaborbernat added the enhancement New feature or request label Jun 24, 2021
@gaborbernat
Copy link
Member Author

These nowadays should live within pyproject.toml so this will be a won't do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants