
diff-dirty: only the files modified in the git working tree ( git status).scalafmtFilter: String (default ""): optionally limits the.⚠️ This option is discouraged since it messes up undo buffers in theĮditor and it slows down compilation.scalafmtOnCompile: Boolean: Defines if the sbt-scalafmt should run scalafmt.scalafmtConfig: File: The location of the.Task for all configurations in which it is enabled (since v2.0.0-RC5) scalafmtAll or scalafmtCheckAll: Execute the scalafmt or scalafmtCheck.scalafmtSbtCheck: Check if the files have been formatted by scalafmtSbt.
scalafmtSbt: Format *.sbt and project/*.scala files. scalafmtCheck: Check if the scala sources under the project have been. myproject/test:scalafmt: Format test sources of myproject project. myproject/scalafmt: Format main sources of myproject project. To configure the scalafmt version add the following line into. Latest published version of the sbt plugin: Note, does not support sbt 0.13, only sbt 1.x.ĪddSbtPlugin( "org.scalameta" % "sbt-scalafmt" % SBT_PLUGIN_VERSION) nf configuration file and downloaded dynamically. Independently, their versions do not align. NB: keep in mind that versions of scalafmt-core and sbt-scalafmt are released You can find more information on triggering a format request for individual nf, upon receiving the firstįormat request Metals will create the. To formatting requests from the editor, according to the configuration defined Metals automatically uses Scalafmt to respond For more details, refer to the MetalsĮmacs also supports scalafmt as one of its formatters. You can use the Metals language server to format code with Scalafmt It is not possible to reset this setting for all existing projects. Open Preferences > Editor > Code Style > Scala. To reset the formatter to IntelliJ for an existing project that uses the Preferences > Editor > Code Style > Scalaįile > Other Settings > Preferences for New Projects… > Editor > Code Style > Scala It is not recommended toĬhange this, and is instead recommended to format files when saving. IntelliJ uses its own formatter for ranges by default. Selected ranges of code may produce undesirable results. Scalafmt is primarily designed to operate on entire text files-formatting You must use an older version, see the FAQ for an alternative.
To support Scalafmt and the dynamic version set in your. Note: IntelliJ 2019.1 or later is required in order for the Scala plugin nf file, you will beĬhoose the scalafmt formatter and IntelliJ's Reformat Code action will then DO NOT install theĭeprecated Scalafmt plugin unless you have an older version of Intellij. The Scala plugin compatible with recent versions of IntelliJ IDEA hasīuilt-in support for Scalafmt (see Note below). You can use Scalafmt from your editor, build tool or terminal.