Introducing Deprecool

Zac Radford
Software Engineer

Let’s make updating a little bit easier.

Deprecool is a static code analysis tool for Ruby that uses Prism to find sources of deprecation warnings in your code.

Use Deprecool alongside the warnings that are emitted at runtime by your gems to get a complete picture of what you need to fix, where you need to fix it and why.

Each warning that Deprecool logs will come with a summary , references to when the deprecation was added to its gem (usually the PR that introduced it), an effort estimate, and a suggestion of how to fix the deprecation. The source code line of the warning is of course logged as well:

At first, the suggestions will come from the deprecation source's gem maintainers own words. Eventually though, with some feedback we can pass on knowledge and examples of how to manage the more difficult deprecations to future developers trying to upgrade.

Getting Started

You can either:

  1. add deprecool to your application's Gemfile and bundle install,
  2. or run gem install deprecool directly to be able to use the deprecool executable on any ruby code you have.

deprecool scan is all you need to run if your current directory contains a Gemfile.lock, but if you want to you can also run deprecool scan path/to/your/code.rb

By default, Deprecool will use the gems and versions in your Gemfile.lock to know how to find deprecations, but you can also pass --gem=list,of,gems (no spaces!) to only look for certain gems at one time.

Right now, Deprecool has a small handful of deprecations it can find, but I will continue adding more. I’ve also tried to make contributing to Deprecool as simple as possible with one Finder class per warning, and a few helper methods to make writing tests trivial.

Meet me here when you are ready to get deprecool!

Zac Radford
Software Engineer
Zac Radford
Software Engineer
Zac Radford
Software Engineer
Zac Radford
Software Engineer