Scalafix is a refactoring and linting tool for Scala.
It provides a framework for detecting problematic source constructs as well as applying automated rewrites, making it useful for both code-quality enforcement and large-scale source migrations. Rules can operate purely on syntax or use semantic information supplied by SemanticDB, allowing analysis based on symbols and types when deeper knowledge of a program is required. Scalafix can be used with its built-in rules or extended with rules created by individual projects and the wider Scala community.
This is free and open source software.
Key Features
- Supports both linter rules, which report diagnostics, and rewrite rules, which modify source code.
- Provides syntactic rules that can inspect source code without compiling it first.
- Offers semantic rules with access to symbols, types and other compiler-derived information through SemanticDB.
- Includes rules for organising imports, removing unused code and adding explicit result types.
- Can prohibit selected Scala constructs including variables, nulls, exceptions, returns, loops and unsafe type casts.
- Supports project configuration through a
.scalafix.conffile using HOCON syntax. - Allows external rules to be distributed as dependencies and loaded alongside the built-in rule set.
- Supports local project-specific rules for checks and transformations that do not need to be published separately.
- Can check whether files require changes without modifying them, making it suitable for continuous integration workflows.
- Can restrict processing to files changed relative to a Git branch, commit or tag.
- Provides an API for developing configurable syntactic and semantic rules, diagnostics and source-code patches.
Website: github.com/scalacenter/scalafix
Support:
Developer: Scala Center and contributors
License: BSD 3-Clause “New” or “Revised” License
Scalafix is written in Scala. Learn Scala with our recommended free books and free tutorials.
Explore our comprehensive directory of recommended free and open source software. Our carefully curated collection spans every major software category.This directory is part of our ongoing series of informative articles for Linux enthusiasts. It features hundreds of detailed reviews, along with open source alternatives to proprietary solutions from major corporations such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk. You’ll also find interesting projects to try, hardware coverage, free programming books and tutorials, and much more. Discovered a useful open source Linux program that we haven’t covered yet? Let us know by completing this form. |


Please read our Comment Policy before commenting.