Forrest logo
back to the scalafmt tool

scalafmt:tldr:003a2

scalafmt: Reformat specific files or directories with a custom formatting configuration.
$ scalafmt --config ${path-to--scalafmt-conf} ${filename_or_directory} ${filename_or_directory} ${---}
try on your machine

The scalafmt command is used to format Scala source code according to a set of predefined formatting rules. It can be run from the command line.

Here is the breakdown of the provided command:

  • --config ${path-to--scalafmt-conf}: This flag is used to specify the path to a configuration file for scalafmt. The configuration file provides the formatting rules and settings to apply. ${path-to--scalafmt-conf} should be replaced with the actual path to the configuration file.

  • ${filename_or_directory}: This is a placeholder for specifying one or more filenames or directories to format. It can be a single file, or a directory containing multiple files. Multiple files or directories can be separated by spaces.

  • ${---}: This part of the command is likely a mistake or typo, as it does not have any significance or meaning in the context of the scalafmt command. It should be removed or replaced with a valid argument or option specific to your usage.

Overall, the command syntax is used to execute scalafmt with a specified configuration file and format one or more Scala source code files or directories.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the scalafmt tool