refurb
refurb copied to clipboard
Package as a Flake 8 Plugin
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.
+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
Thanks for the advice, I will look into what it takes to make this happen
@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!
I've seen this done for other tools, like for black, in separate packages, and wonder if there is any advantage to that.
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.
I've given this a go but experienced much slower runs than running refurb directly. You can try the branch from this PR #72 .