Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fix link 283f2bf Jun 28, 2019
1 contributor

Users who have contributed to this file

42 lines (31 sloc) 2.16 KB

Scalafix Migrations

Scala Steward can run Scalafix rewrite rules for version updates to not only bump version numbers but to also adapt the code for the new version. This allows to automatically rewrite deprecated code or code that would not compile with the new version of the dependency.

Here are two pull requests that demonstrate this feature:

How does this work?

Scala Steward contains a list of migration rules combined with metadata that describes to which updates they are applicable. When it prepares a pull request and finds that one or more rules match the current update, Scala Steward applies these migration rules via the sbt-scalafix plugin which resolves those rules and edits the source code accordingly.

Writing migration rules for your project

See the Scalafix Developer Guide for more information about writing rewrite rules or have a look at the existing migration rules for inspiration. Rules in Scala Steward must be accessible via the github: or http: schemes.

Adding migration rules to Scala Steward

After you have written a new migration rule for a new version of your project, Scala Steward needs to be made aware of it. Creating a pull request that adds the new rule to the list of migrations is enough for that. Once that pull request is merged, Scala Steward will start using this migration.

Pull requests that added migration rules can be found here.

You can’t perform that action at this time.