DEV Community

Iacopo Spalletti
Iacopo Spalletti

Posted on • Originally published at sleepy.yaks.industries

2 1

TIL - 🧹 unimport linter formatter

Thanks to this Jeff Triplets tweet I discovered unimport, which is an interesting tool to detect unused imports (like flake8 would do) and to remove them from the code.

And the cherry on top it's that it can scan the requirements file and detect unused dependencies (which is probably even more important).

Historically this has not been a problem for me (or Nephila team), as flake8 is already well ingrained in our workflow, so we are used to handle code cleanup before committing.

But as I sometimes inherit a large codebase with messy code, and it's awesome how much you can achieve with the right tools.

Currently isort + black + pyupgrade already do a really good job, but adding unimport to the equation is 💥: a much nicer codebase with zero effort

I will surely give it a more in depth test, and I might add to my linting reference toolbox.

Shootout to Hakan Çelik for this package, and its awesome documentation.

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Retry later