sneferu format
Format .snf files, theme.json and locale files with Prettier and the Sneferu plugin. Usage, options, output, exit codes and errors.
On this page
Format .snf files, theme.json and locale files with Prettier and the Sneferu plugin.
Rewrites .snf (and .sneferu) files, theme.json and locales in place. With --check nothing is written and the exit code says whether the folder is formatted.
Usage
sneferu format [options] [dir]Arguments
| Argument | Required | Default | Description |
|---|---|---|---|
dir | no | . | Theme folder. |
Options
| Option | Default | Description |
|---|---|---|
--check | off | Only check; exit 1 if a file is not formatted (for CI). |
Examples
sneferu formatFormats the current folder.
sneferu format --checkCI: fails when any file needs formatting.
Output
sneferu format my-theme --check (exit 0)
✔ all 46 files are formattedsneferu format my-theme --check (exit 1): After adding a badly formatted snippet.
snippets/demo.snf is not formatted
✖ 1 of 47 files need formatting (run sneferu format)sneferu format my-theme (exit 0)
snippets/demo.snf formatted
✔ formatted 1 of 47 filesExit codes
| Code | Meaning |
|---|---|
0 | Formatted, or (with --check) nothing needed formatting. |
1 | With --check, at least one file needs formatting; or formatting failed. |
Common errors
None specific to this command beyond the diagnostics it prints.
