Scalafix – refactoring and linting tool for Scala

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.conf file 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.


Related Software

Scala Linters
ScalafixRefactoring and static analysis tool for improving code quality
ScapegoatStatic analysis tool that detects bugs and questionable code
WartRemoverFlexible tool for enforcing safer coding practices

Read our verdict in the software roundup.


Best Free and Open Source Software Explore our carefully curated directory of recommended free and open source software, covering every major software category.

The directory forms part of our extensive collection of articles for Linux enthusiasts. It includes hundreds of detailed reviews, together with free and open source alternatives to proprietary software from companies such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk.

LinuxLinks also covers interesting projects worth exploring, Linux-compatible hardware, free programming books and tutorials, and much more.

Know a useful free and open source Linux application that we haven’t covered? Tell us about it using our submission form.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted