switchboard lint
Checks macro files or the whole Library against the schema and the lint rules, without needing the engine.
Details #
switchboard lint [path...] checks macros and prints one line per finding, then a total.
Without a path it checks the whole Library. A folder is read as a Library with groups inside. A single file is read as one macro and validated against the schema first.
switchboard lint
switchboard lint ~/Desktop/my-macro.json
error Paste ticket as title do: step id "s2" is used more than once
1 errors, 0 warnings
Lines start with error or warning. Each line is the severity, the macro name (or the file path), the place in the macro and the message. The exit code is 1 when there is at least one error, otherwise 0. Warnings alone do not fail.
Lint runs locally. The engine does not need to be running.
Parameters #
switchboard lint [path…]
Check macros (default: the Library); exit 1 on errors.
Examples #
# fail a script when a shared folder has a broken macro
switchboard lint ./team-macros || exit 1
Gotchas #
A
runMacrotarget cannot be checked from a single file, so that check is skipped for files.lintdoes not take options. An argument starting with-exits with 64.