
nf // project/MyScalafmtPlugin.scala import sbt. To share configuration across different sbt builds, create a custom sbt plugin Use scalafmtConfigSettings to enable the plugin for integration tests and then The sbt plugin is enabled by default for the Test and Compile configurations. scalafmtPrintDiff: Boolean: if set, check will display theĭifferences for incorrectly formatted files.depending on scalafmtLogOnEachError, fail on the first error or only at the end.scalafmtFailOnErrors: Boolean: if set, plugin will fail on errors.scalafmtLogOnEachError: Boolean: if set, plugin will log errors.(whether logging or throwing an exception), include the stacktrace as well scalafmtDetailedError: Boolean: if set, when handling a specific error.diff-ref=: only the tracked files modified since ( git diff).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) In the dialog that opens, select the file with the settings and click Open.
Intellij format code code#
Press Ctrl+Alt+S to open the IDE settings and select Editor Code Style.
Intellij format code install#
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). By clicking " Tools" -> " FormatCode".You can use Scalafmt from your editor, build tool or terminal. IntelliJ IDEA is currently, probably, the most popular IDE for Java projects. You may now invoke FormatCode command line tool by two ways:Ģ. Then, please define your keymap as show below: In the " Action" column, expand the External Tools tree node, select the " Shortcuts" cell in the " FormatCode" row.Ĥ. Name your new keymap something like My Keymap.ģ. Click the default keymap, then press " Copy". Working Directory: C:\Program Files\FormatCode\Īdd a keymapping so you can invoke FormatCode using Ctrl+TĢ.Program: C:\Program Files\FormatCode\FormatCode.exe.Description: Format Current File With FormatCode.Please fill in the form as show below: (Assuming you installed FormatCode in C:\Program Files\FormatCode\) Click " Add." button, then click " External Tools".ģ.
Intellij format code trial#
We used a free trial version of IntelliJ IDEA Version 3.0, so if you useĪn older or even a newer version then several screenshots or menu items may differ from our description.Īdd a Tool Menu that will invoke FormatCodeġ. The following instructions allow you to format and beautify the current open Java source code file in IntelliJ IDEA Java IDE
