docs: update FORMAT.md
This commit is contained in:
parent
2062564afd
commit
5479081abe
|
@ -12,7 +12,7 @@ All files should adhere to these formatting guidelines.
|
||||||
|
|
||||||
- Avoid trailing spaces and tabs.
|
- Avoid trailing spaces and tabs.
|
||||||
|
|
||||||
- Avoid usage of non utf-8 encoding.
|
- Avoid usage of non UTF-8 encoding.
|
||||||
|
|
||||||
- Comments should be compact. Do not tab them if not necessary.
|
- Comments should be compact. Do not tab them if not necessary.
|
||||||
|
|
||||||
|
@ -22,19 +22,26 @@ All files should adhere to these formatting guidelines.
|
||||||
|
|
||||||
- Do not export variables if not necessary.
|
- Do not export variables if not necessary.
|
||||||
|
|
||||||
- Custom variables in build.sh scripts should be defined inside functions. If you need a "global scope" variable at build time, just define it in `termux_step_pre_configure()`. If you still need to define variable outside of function, make sure that it does not use command or process substitution.
|
- Custom variables in build.sh scripts should be defined inside functions.
|
||||||
|
If you need a "global scope" variable at build time, just define it in
|
||||||
|
`termux_step_pre_configure()`. If you still need to define variable outside
|
||||||
|
of function, make sure that it does not use command or process substitution.
|
||||||
|
|
||||||
- Dollar parentheses `$()` rather than backticks ``` `` ``` should be employed in command substitution.
|
- Dollar parentheses `$()` rather than backticks ``` `` ``` should be employed
|
||||||
|
in command substitution.
|
||||||
|
|
||||||
- Usage of `sudo` or `su` in build scripts is disallowed.
|
- Usage of `sudo` or `su` in build scripts is disallowed.
|
||||||
|
|
||||||
- Utility `install` is preferred over `cp` as the file installation program.
|
- Utility `install` is preferred over `cp` as the file installation program.
|
||||||
|
|
||||||
- Do not hardcode version numbers. Instead, use the `$TERMUX_PKG_VERSION` and `$TERMUX_PKG_REVISION` variables.
|
- Do not hardcode version numbers. Instead, use the `$TERMUX_PKG_VERSION` and
|
||||||
|
`$TERMUX_PKG_REVISION` variables.
|
||||||
|
|
||||||
- Do not hardcode Termux prefix directory. Instead, use the `$TERMUX_PREFIX` variable.
|
- Do not hardcode Termux prefix directory. Instead, use the `$TERMUX_PREFIX`
|
||||||
|
variable.
|
||||||
|
|
||||||
- Do not hardcode Termux home directory. Instead, use the `$TERMUX_ANDROID_HOME` variable.
|
- Do not hardcode Termux home directory. Instead, use the `$TERMUX_ANDROID_HOME`
|
||||||
|
variable.
|
||||||
|
|
||||||
## Markdown Formatting
|
## Markdown Formatting
|
||||||
|
|
||||||
|
@ -55,3 +62,5 @@ All files should adhere to these formatting guidelines.
|
||||||
- All names of `.md` should be capitalised.
|
- All names of `.md` should be capitalised.
|
||||||
|
|
||||||
- All code blocks should be enclosed in backticks, with language specified.
|
- All code blocks should be enclosed in backticks, with language specified.
|
||||||
|
|
||||||
|
- Lines shouldn't be longer than 80 characters.
|
||||||
|
|
Loading…
Reference in New Issue