SCUA

Manual

scua.toml

scua.toml is a project's manifest. scua finds it by looking next to the file you run and then upward, stopping at the top of your repository (the first directory with a .git) or at your home directory, so a stray manifest higher up can never capture your script. A script with no scua.toml above it runs exactly as if none existed. A scua.toml inside a locked package's folder (under a project's deps/) is passed over: a script there belongs to the project whose lock vendored the package.

The file is data and never runs. A scua.toml beside your code grants no capability on its own: grants come from the command line (see Which grant wins). Its [exec] list says which commands the program may run, and only --allow-exec on the command line turns it on.

default = "debug"

[package]
name = "@acme/report"
scua-version = "0.31"

[dependencies]
"@acme/json" = "1.2.0"

[build.debug]
debug = true

[build.release]
debug = false

[run]
warnings = false

[run.ci]
warnings = true

[tooling]
declarations = ["decls/gfx.scua"]

#default

The profile a run uses when you don't pass --profile. A profile is a name used by [build.<name>], [run.<name>] or both.

#[package]

What the project is. name is its package name. scua-version is the oldest scua it runs on: a scua older than that refuses to start and exits with status 3. See Requiring a minimum scua.

#[app]

id is the program's app id, the name of its per-user folder: three or more lowercase parts, such as com.unabated.tinykeep. It is a check, not a grant. A launch whose --allow-user names a different id stops with status 2 (E-USER-MISMATCH), since a different id is a different, empty save folder, and --user-dir alone holds the folder under this id. A program that never uses the per-user folder needs no [app] table.

#[exec]

commands lists the commands the program may run with exec.run and exec.spawn, each an argv template: a list of strings, the program first, with {string} or {int} holes for the parts chosen at run time.

[exec]
commands = [
  ["git", "status"],
  ["git", "log", "--oneline", "-n", "{int}"],
]

The list grants nothing until a launch names --allow-exec, and then the program may run those commands and no others; see Declaring commands ahead of time for how a call matches a template. --allow-exec with no list, an empty list or a malformed template stops the run with status 2 before any of it runs. Only the project's own scua.toml is read: one inside a locked package's folder that lists commands is refused. So is a list the program could rewrite, because --allow-fs (or the per-user folder) reaches the scua.toml or the program's own folder: grant a folder of its own instead, such as --allow-fs=./data. See E-EXEC-POLICY.

#[dependencies]

The packages the project depends on, each with the minimum version it needs. scua add writes these for you; see Modules you depend on by name.

#[build.<profile>]

Build flags for comptime if, one table per profile. Each key becomes a build flag your program can read, the same as -D name=value on the command line, which wins over the profile. See --profile.

#[run] and [run.<profile>]

Settings for a run of the project, which your program can't see. [run] applies to every run, and [run.<profile>] to runs under that profile, where it overrides [run]. Unlike [build.<profile>], nothing here becomes a build flag.

Key Values Default Command line
warnings true or false true --no-warnings, --warnings

warnings = false keeps compile warnings off stderr for everyone who runs the project, in scua, scua test and scua debug, as --no-warnings does. Errors still print and still stop the run. A warning in a --!strict file still prints, since it stops the run, and so does the one-line notice that a package you depend on needs updating. Your editor keeps showing every warning.

The command line wins in both directions, without an error: --warnings shows warnings the file turns off, --no-warnings hides them where it doesn't, and --deny-warnings or --dep-warnings, which ask to see or count warnings, show them too. So a project can be quiet by default while its CI still runs scua --deny-warnings.

Any value other than true or false stops the run with status 2 rather than being ignored. An application bundle carries no scua.toml, so this table doesn't apply to it.

#[tooling]

declarations lists files that describe a host's native API to the editor and the checker, in the order you write them. See Embed SCUA in a host.