mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-04-22 05:42:09 +02:00
scalafmt: add page (#6808)
This commit is contained in:
parent
442d31e535
commit
96970ddbef
1 changed files with 25 additions and 0 deletions
25
pages/common/scalafmt.md
Normal file
25
pages/common/scalafmt.md
Normal file
|
@ -0,0 +1,25 @@
|
|||
# scalafmt
|
||||
|
||||
> Code formatter for Scala.
|
||||
> Configurations are stored in the `.scalafmt.conf` file.
|
||||
> More information: <https://scalameta.org/scalafmt>.
|
||||
|
||||
- Reformat all `.scala` files in the current directory recursively:
|
||||
|
||||
`scalafmt`
|
||||
|
||||
- Reformat specific files or directories with a custom formatting configuration:
|
||||
|
||||
`scalafmt --config {{path/to/.scalafmt.conf}} {{path/to/file_or_directory}} {{path/to/file_or_directory}} {{...}}`
|
||||
|
||||
- Check if files are correctly formatted, returning `0` if all files respect the formatting style:
|
||||
|
||||
`scalafmt --config {{path/to/.scalafmt.conf}} --test`
|
||||
|
||||
- Exclude files or directories:
|
||||
|
||||
`scalafmt --exclude {{path/to/file_or_directory}} {{...}}`
|
||||
|
||||
- Format only files that were edited against the current Git branch:
|
||||
|
||||
`scalafmt --config {{path/to/.scalafmt.conf}} --mode diff`
|
Loading…
Add table
Reference in a new issue