Scalafix

Scalafix

  • User guide
  • Developer guide
  • Browse sources
  • GitHub

›Rules

Usage

  • Installation
  • Configuration
  • Suppressing rules

Rules

  • All rules
  • RemoveUnused
  • DisableSyntax
  • NoAutoTupling
  • LeakingImplicitClassVal
  • NoValInForComprehension
  • ProcedureSyntax

Misc

  • Related projects
Edit

Built-in Rules

Scalafix comes with a small set of built-in rules. Rules are either syntactic or semantic.

Syntactic: the rule can run directly on source code without compilation. Syntactic rules are simple to run but they can only do limited code analysis since they do not have access to information such as symbols and types.

Semantic: the rule requires input sources to be compiled beforehand with the Scala compiler and the SemanticDB compiler plugin enabled. Semantic rules are more complicated to run but they can do more advanced code analysis based on symbols and types.

Semantic Rules

NameDescription
NoAutoTuplingInserts explicit tuples for adapted argument lists for compatibility with -Yno-adapted-args
RemoveUnusedRemoves unused imports and terms that reported by the compiler under -Ywarn-unused

Syntactic Rules

NameDescription
DisableSyntaxReports an error for disabled features such as var or XML literals.
LeakingImplicitClassValAdds 'private' to val parameters of implicit value classes
NoValInForComprehensionRemoves deprecated val inside for-comprehension binders
ProcedureSyntaxReplaces deprecated procedure syntax with explicit ': Unit ='
← PreviousNext →
Scalafix
Docs
Get startedRulesExtend Scalafix
Community
Chat on GitterDiscuss on Scala Users
More
GitHub
Copyright © 2018 Scala Center