docs: update

This commit is contained in:
Dylan Araps 2018-06-03 12:19:03 +10:00
parent f51de7f139
commit 320ad76b21
1 changed files with 4 additions and 7 deletions

View File

@ -23,20 +23,15 @@
and variable names. and variable names.
- Keep lines below `100` characters long. - Keep lines below `100` characters long.
- Use `[[ ]]` for tests. - Use `[[ ]]` for tests.
- Double Quote **EVERYTHING**. - Quote **EVERYTHING**.
- Dont use single quotes, except for special cases.
### ShellCheck ### ShellCheck
For your contribution to be accepted, your changes need to pass For your contribution to be accepted, your changes need to pass
ShellCheck. ShellCheck.
Run ShellCheck with the following command:
```sh ```sh
# Why do we exclude numerous tests? shellcheck neofetch
# See: https://github.com/dylanaraps/neofetch/wiki/Shellcheck-Exclusions
shellcheck neofetch -e SC1090,SC2009,SC2012,SC2016,SC2034,SC2128,SC2153,SC2154,SC2178,SC2010,SC1004,SC1091,SC1117
``` ```
**Note**: If you have trouble installing ShellCheck. You can open a pull **Note**: If you have trouble installing ShellCheck. You can open a pull
@ -58,6 +53,8 @@ request on the repo and our Travis.ci hook will run ShellCheck for you.
- Use `bash`'s built-in syntax (`file="$(< /path/to/file.txt)")`). - Use `bash`'s built-in syntax (`file="$(< /path/to/file.txt)")`).
- Dont use `grep "pattern" | awk '{ printf }'`. - Dont use `grep "pattern" | awk '{ printf }'`.
- Use `awk '/pattern/ { printf }'` - Use `awk '/pattern/ { printf }'`
- Dont use `wc`.
- Use `${#var}` or `${#arr[@]}`.
### If Statements ### If Statements