Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📖 What is this PR about?
Fixes #21
In #21 it was suggested Refurb could be packaged as a Flake8 extension.
This PR tries that.
FRB is chosen as error-code, similar to the existing FURB code, but Flake8 has a max prefix length of 3.
🤔 Some learnings
🔕 Disabled by default
The plugin is disabled by default and thus requires running flake8 with
--enable-extensions FRB
When the flake8 plugin for a particular tool is packaged separately, it's okay to enable it by default. We can interpret its installation as an explicit desire to run it as part of flake8.
However, including the plugin as part of the tool itself, like it is done in the PR, does not allow us to reach the same conclusion. Somebody might install Refurb to run it standalone and just by doing this, we should make subsequent flake8 runs slower.
Even if running Refurb were extremely fast, I think activation should still be explicit.
Alternatively, we could have a separate package to provide the plugin.