Modules best practices
Checklist:
Perform module static analysis
space -m spacechecker /run/ -- .
Spell checking
:set spell
Document all shell script functions for
spacedoc
exportDocument all nodes in the configuration file with proper Title and Description i.e.
_info/title
and_info/desc
Run shell script static code analysis tools:
checkbashisms
andshellcheck
Generate README file
GENERATE_VARIABLES=0 GENERATE_TOC=0 space -f ../space/tools/spacedoc/Spacefile.yaml /module/ -- Spacefile.sh
Create test directory with testrunner-compatible tests
Add continuous integration targets for running tests on external test and build servers
Always take careful action when making decisions based on data gathered, be it locally or remotely, because data could be tampered, misdirected or turned malicious by a compromised remote server.
Make sure build time module functions specify
SPACE_FN
header variable at the beginning of the function scope for clarity. Preferably in the very first line or the second line if first line isSPACE_SIGNATURE=""
.
Previous: Modules versioning
Next: Modules advanced topics
Edit this page