Linting
The sbuild tool includes a built-in linter that validates SBUILD recipes before execution. It checks for required fields, correct types, valid values, and runs shellcheck on shell scripts.
Prerequisites
- shellcheck — used to validate
x_exec.runandx_exec.pkgverblocks
bash
soar install shellcheckInstallation
bash
soar install sbuildOr download directly from sbuilder releases.
Usage
bash
# Validate a single file
sbuild lint ./myapp.yaml
# Validate multiple files
sbuild lint ./packages/*.yaml
# Validate in parallel
sbuild lint -p 8 ./packages/*.yaml
# Run in pkgver mode (execute pkgver scripts)
sbuild lint -P ./myapp.yaml
# Skip shellcheck validation
sbuild lint --no-shellcheck ./myapp.yamlWhat It Checks
- Required fields:
_disabled,pkg,description,src_url,ghcr_pkg, andx_execmust be present - Field types: Arrays must be arrays, strings must be strings
- Valid values:
pkg_typemust be a recognized format,categorymust match FreeDesktop spec - Name constraints:
pkg,pkg_id,app_idonly allow[a-zA-Z0-9+\-_.] - Shell syntax: Validates
x_exec.pkgverandx_exec.runblocks via shellcheck - URL format:
src_url,homepageentries must be valid URLs - Host triples:
x_exec.hostentries must match{arch}-{os}format
Common Errors
Missing required field
ERROR: field 'description' is required but missingAdd the missing field to your SBUILD.
Invalid pkg_type
ERROR: invalid pkg_type 'Appimage', must be lowercaseUse lowercase values: appimage, not Appimage or AppImage.
Empty x_exec.run
ERROR: x_exec.run must not be emptyThe run block must contain actual shell commands.
Pre-submission Checklist
Before submitting an SBUILD to soarpkgs:
- Run
sbuild lint— no errors - Test the build locally with
sbuild build
