On this page you find all important commands for the CLI tool scalafmt. If the
command you are looking for is missing please ask our AI.
scalafmt
Scalafmt is a command-line tool used for formatting Scala code. It aims to provide a consistent and opinionated code style across different Scala projects.
- Scalafmt uses a default formatting style, but it also allows customization through configuration files.
- It can handle different code formats, including .scala files and even Scala code embedded in .md or .html files.
- The tool supports formatting scenarios like indentation, line wrapping, blank lines, and more.
- Scalafmt can preserve some manual formatting to maintain user preferences while ensuring consistent formatting for the remaining code.
- It supports various customization options, allowing project-specific formatting rules to be enforced.
- The tool has integrations with popular Scala editors and build tools like IntelliJ IDEA, sbt, and Maven.
- Scalafmt can be executed as a command-line tool, making it easy to incorporate into automated build processes or code review workflows.
- The formatting process is fast, thanks to its incremental algorithm that only formats the modified code instead of reformatting the entire file.
- Scalafmt is actively maintained and frequently updated to support the latest Scala language features and keep up with the community's evolving coding standards.
- The project is open source, allowing developers to contribute to its development or tailor the tool to their specific needs.
List of commands for scalafmt:
-
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 machineexplain this command
-
scalafmt:tldr:24d0d scalafmt: Check if files are correctly formatted, returning `0` if all files respect the formatting style.$ scalafmt --config ${path-to--scalafmt-conf} --testtry on your machineexplain this command
-
scalafmt:tldr:5b819 scalafmt: Exclude files or directories.$ scalafmt --exclude ${filename_or_directory} ${---}try on your machineexplain this command
-
scalafmt:tldr:5c3ad scalafmt: Format only files that were edited against the current Git branch.$ scalafmt --config ${path-to--scalafmt-conf} --mode difftry on your machineexplain this command
-
scalafmt:tldr:6a240 scalafmt: Reformat all `.scala` files in the current directory recursively.$ scalafmttry on your machineexplain this command