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

Package as a Flake 8 Plugin #21

Open
krid opened this issue Sep 29, 2022 · 6 comments · May be fixed by #72
Open

Package as a Flake 8 Plugin #21

krid opened this issue Sep 29, 2022 · 6 comments · May be fixed by #72
Labels
enhancement New feature or request

Comments

@krid
Copy link

krid commented Sep 29, 2022

Refurb would make a lovely addition to the Flake 8 toolbox. We're already using that for our project, so it would be nice to add refurb in and get IDE integration and one-stop shopping.

@ksdaftari
Copy link

+1
You'd get a lot niceties with flake8 as well such as temporarily ignoring code via noqa (sometimes needed), robust configuration (eg codes to include, can be based on file path pattern, etc), nice integration with pre-commit, etc

@dosisod
Copy link
Owner

dosisod commented Oct 1, 2022

Thanks for the advice, I will look into what it takes to make this happen

@dosisod
Copy link
Owner

dosisod commented Oct 1, 2022

@ksdaftari , Refurb does support noqa comments (See the README), it also has some support for ignoring errors via a config file (though not to the extent of flake8), and also has pre-commit support.

Adding a flake8 plugin will be nice for adding support to IDEs and such, though there are lots of kinks that need to be worked out in Refurb before I can dedicate time to this. If someone else who has experience writing flake8 plugins is able to implement this I would be happy to review it!

@dosisod dosisod added the enhancement New feature or request label Oct 1, 2022
@jdevera
Copy link
Contributor

jdevera commented Oct 3, 2022

I've seen this done for other tools, like for black, in separate packages, and wonder if there is any advantage to that.

@henryiii
Copy link

henryiii commented Oct 5, 2022

FYI, it's fairly easy to make flake8 plugins. See https://github.com/henryiii/flake8-errmsg for a fairly simple (and Python 3.10 pattern matching :) ) example. You don't even need to depend on flake8. IIRC, I watch a video by mcoding that was really good in describing how to make a flake8 plugin.

@jdevera jdevera linked a pull request Oct 15, 2022 that will close this issue
@jdevera
Copy link
Contributor

jdevera commented Oct 15, 2022

I've given this a go but experienced much slower runs than running refurb directly. You can try the branch from this PR #72 .

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

Successfully merging a pull request may close this issue.

5 participants