termux-packages/docs/FORMAT.md

44 lines
1.2 KiB
Markdown
Raw Normal View History

2019-02-12 02:45:08 +01:00
# Formatting Guidelines
All files should adhere to these formatting guidelines.
2019-02-13 00:33:20 +01:00
## Shell Script Formatting
2019-02-12 02:45:08 +01:00
- All `build.sh` should be set to `644` permission.
- All scripts should use tabs rather than spaces.
- All parantheses of shell functions should not be preceded with a space.
- Avoid use of non utf-8 encoding.
- Comments should be compact. Do not tab them if not necessary.
2019-02-13 00:33:20 +01:00
## Shell Script Coding Practices
2019-02-12 02:45:08 +01:00
- Dollar parentheses `$()` rather than backticks ``` `` ``` should be employed in command substitution.
2019-02-13 00:33:20 +01:00
- `install` is preferred over `cp` as the installation program.
- Version numbers should never be hard-coded. Instead, use the `$TERMUX_PKG_VERSION` and `$TERMUX_PKG_REVISION` variables.
## Markdown Formatting
2019-02-12 02:45:08 +01:00
- All `filenames` should be under code formatting, unless they are links.
- All titles should be indented with hashes rather than equal signs.
- All unnumbered lists should be indented with hyphens.
- All Markdown should be edited on alternate line.
- All Markdown should use tabs rather than spaces.
- All `.md` should be set to `644` permission.
- All characters should be escaped.
- All names of `.md` should be capitalised.
- All code blocks should be enclosed in backticks, with language specified.