Add section about code conventions to DEVELOP.md (#185)

This adds details about shfmt and shellcheck settings.

Closes #180

Signed-off-by: Justin Scott <justin.a.scott@intel.com>
This commit is contained in:
Justin Scott
2019-10-02 11:19:22 -07:00
committed by GitHub
parent 5c8f4e89a1
commit 7c352427a2
+31 -1
View File
@@ -1,6 +1,36 @@
# Developer
This document describes the key concepts and technologies used in the project.
This document describes the key concepts and technologies used in the project, and lists the ways to contribute to the
project.
## Code Conventions
### Shell Scripts
Shell scripts should adhere to the [Google Shell Style Guide](https://google.github.io/styleguide/shell.xml) as much as
possible.
#### Formatting with `shfmt`
The [shfmt](https://github.com/mvdan/sh#shfmt) tool should be used to format shell scripts with 2 spaces and should use
the following parameters:
```shell script
shfmt -i 2 -ci
```
#### Linting with shellcheck
The [shellcheck](https://github.com/koalaman/shellcheck) tool should be used to identify issues with the scripts
themselves. The config file for shellcheck is typically found in `~/.shellcheckrc` and should include rules that
are [ignored](https://github.com/koalaman/shellcheck/wiki/Ignore) project wide.
```shell script
# ~/.shellcheckrc
# disabled rules here
```
## Kustomize Usage