sneferu validate
Check a theme folder against the compiler and report every diagnostic. Usage, options, output, exit codes and errors.
On this page
Check a theme folder against the compiler and report every diagnostic.
Compiles the folder with the real Sneferu compiler and prints one line per problem in the form file:line:col severity CODE message, then a summary. Nothing is written. Every code links to its page under Errors.
Usage
sneferu validate [dir]Arguments
| Argument | Required | Default | Description |
|---|---|---|---|
dir | no | . | Theme folder. |
Options
None.
Examples
sneferu validateValidates the current folder.
sneferu validate my-themeValidates ./my-theme.
Output
sneferu validate my-theme (exit 0)
✔ theme [email protected] is validsneferu validate my-theme (exit 1): After adding a snippet with a script tag, an onclick handler and an img without size.
snippets/demo.snf:1:1 error SN2001 <script> is not allowed in themes
snippets/demo.snf:2:4 error SN2002 attribute 'onclick' is not allowed
snippets/demo.snf:3:1 warning SN2015 <img> without width and height; set both so the page does not jump while the image loads
✖ 2 errors, 1 warningsneferu validate nope (exit 1)
error ENOENT: no such file or directory, scandir 'nope'Exit codes
| Code | Meaning |
|---|---|
0 | No errors. Warnings alone do not fail validation. |
1 | At least one error, or the folder could not be read. |
Common errors
error ENOENT: no such file or directory, scandir '<dir>'
The folder does not exist. Check the path, or create the theme with sneferu init.
error SN3001 theme.json is missing
The folder has no theme.json at its root; typically validate was run one level too high or low. Run it in the theme folder (the one that holds theme.json). See SN3001.
