awesome-python icon indicating copy to clipboard operation
awesome-python copied to clipboard

Add refurb.

Open jdevera opened this issue 3 years ago • 3 comments

What is this Python project?

Refurb is a code checker that uses pattern matching on abstract syntax trees to find patterns in the code and suggest improvements that make the code more readable and/or modern.

I started using it, and it suggested I replace:

try:
    something()
except Exception:
    pass

with:

with contextlib.supress(Exception):
    something()

And got me hooked.

What's the difference between this Python project and similar ones?

This project covers the code once it is correct, so it's compatible with other tools such as format checkers, style checkers, linters, type checkers. This will suggest modern approaches to frequently written patterns that are less readable than the suggested alternatives.

I am not aware of other tools in this space.

--

Anyone who agrees with this pull request could submit an Approve review to it.

jdevera avatar Oct 03 '22 17:10 jdevera

Looks great, but seems to need a bit more time. I hit my first bug within less then 5 minutes with refurb.

igordertigor avatar Oct 10 '22 14:10 igordertigor

Thanks for checking. I saw the bug reported 💪. What is your usual policy for revisiting a project?

jdevera avatar Oct 11 '22 15:10 jdevera

I'm not deciding on policies, I'm just voting and sometimes commenting. I should also mention that the bug I reported took only 3 hours to be fixed.

igordertigor avatar Oct 12 '22 07:10 igordertigor