CODINGSTYLE.md 5.83 KiB
Policy for APKBUILDs
This documents defines a policy for writing APKBUILDs.
Standard selection
APKBUILDs are POSIX shell scripts as defined in POSIX.1-2017 Volume 3 POSIX.1-2017 volume 3. Additionally, the following extensions are supported:
- The
local
keyword for introducing variables local to a function is supported, it is briefly documented in the bash manual. - Non-POSIX parameter extensions
are supported. This includes: Substring expansions (e.g.
${var:offset:length}
) and Replacement expansions (e.g.${var/pattern/string}
). The bash manual contains further information on these two expansions.
NOTE: busybox ash
is currently used to evaluate APKBUILDs since it
supports additional POSIX shell extensions your APKBUILD might be
evaluated correctly even if it is not confirming to this policy
document.
Shell Style Considerations
Formatting
Indention
Indent with tabs, don't use spaces. Avoid whitespaces.