forc-fmt
Forc plugin for running the Sway code formatter.
USAGE:
forc-fmt [OPTIONS]
OPTIONS:
-c, --check
Run in 'check' mode.
- Exits with
0if input is formatted correctly. - Exits with1and prints a diff if formatting is required.
-f, --file <FILE>
Formats a single .sw file with the default settings. If not specified, current working directory will be formatted using a Forc.toml configuration
-h, --help
Print help information
-p, --path <PATH>
Path to the project, if not specified, current working directory will be used
-V, --version
Print version information
EXAMPLES: #Run the formatter in check mode on the current directory forc fmt --check
#Run the formatter in check mode on the current directory with short format forc fmt -c
#Run formatter against a given file forc fmt --file src/main.sw
#Run formatter against a given file with short format forc fmt -f src/main.sw
#Run formatter against a given dir forc fmt --path ../tests/
#Run formatter against a given dir with short format forc fmt -p ../tests