Icon HelpCircleForumIcon Link

⌘K

Icon HelpCircleForumIcon Link

Icon LinkForc

Usage: forc-fmt [OPTIONS]

Options:

-c, --check

Run in 'check' mode.

  • Exits with 0 if input is formatted correctly. - Exits with 1 and prints a diff if formatting is required.

-p, --path <PATH>

Path to the project, if not specified, current working directory will be used

-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 (see a summary with '-h')

-V, --version

Print version

EXAMPLES:

Icon LinkRun the formatter in check mode on the current directory

forc fmt --check

Icon LinkRun the formatter in check mode on the current directory with short format

forc fmt -c

Icon LinkRun formatter against a given file

forc fmt --file {path}/src/main.sw

Icon LinkRun formatter against a given file with short format

forc fmt -f {path}/src/main.sw

Icon LinkRun formatter against a given dir

forc fmt --path {path}

Icon LinkRun formatter against a given dir with short format

forc fmt -p {path}