Skip to content
Hekana Spray
Documentation
Getting started
Theme development
Components and tags

Localization

Apps and custom code

Examples and recipes
API reference
Publishing
Build apps
AI development

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

bash
sneferu validate [dir]

Arguments

ArgumentRequiredDefaultDescription
dirno.Theme folder.

Options

None.

Examples

bash
sneferu validate

Validates the current folder.

bash
sneferu validate my-theme

Validates ./my-theme.

Output

sneferu validate my-theme (exit 0)

text
✔ theme [email protected] is valid

sneferu validate my-theme (exit 1): After adding a snippet with a script tag, an onclick handler and an img without size.

text
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 warning

sneferu validate nope (exit 1)

text
error ENOENT: no such file or directory, scandir 'nope'

Exit codes

CodeMeaning
0No errors. Warnings alone do not fail validation.
1At 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.

Next steps