The Scala plugin compatible with recent versions of IntelliJ IDEA has built-in support for Scalafmt. Spend more time discussing important issues in code review and less time on code style. Scalafmt formats code so that it looks consistent between people on your team. Run scalafmt from your editor, build tool or terminal. Scalafmt has integrations with IntelliJ, sbt, Maven, Gradle and Mill. Choose the scalafmt formatter and IntelliJ's Reformat Code action will then use Scalafmt when formatting files. Scalafmt is primarily designed to operate on entire text files—formatting selected ranges of code may produce undesirable results. For this reason, IntelliJ uses its own formatter for ranges by default. It is not recommended to change this, and is instead recommended to format files when saving.