scalafmt:tldr:5c3ad
The command scalafmt is used to format Scala code according to a specified configuration.
Here is an explanation of each part of the command:
-
--config ${path-to--scalafmt-conf}: This flag specifies the path to thescalafmtconfiguration file (usually named.scalafmt.conf). The configuration file defines the formatting rules to be applied to the Scala code. This flag is optional, and if it is not provided,scalafmtwill search for a configuration file in the current directory and its parents. -
--mode diff: This flag specifies the mode in whichscalafmtoperates. Thediffmode is used to only format the changes made to the Scala code since the last formatting. It avoids reformatting the whole codebase and only applies the necessary changes to ensure consistent formatting.
Overall, the command scalafmt --config ${path-to--scalafmt-conf} --mode diff will format the changes made to the Scala code according to the specified scalafmt configuration file.