aboutsummaryrefslogtreecommitdiffstats
path: root/CODINGSTYLE.md
diff options
context:
space:
mode:
authorSimon F <simon@fraho.eu>2019-07-24 17:34:17 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2019-07-26 13:29:35 +0000
commit36151e1e21aaff5cd0f602eeaebf5d741ff6c2e9 (patch)
treeea07b285feeb07ccb1b6cb709f1fc331f6f331c1 /CODINGSTYLE.md
parent1926d74ad1256930c958bfe9a5308e8198e0fea5 (diff)
Update CODINGSTYLE.md
Spotted some minor typos, improved some wordings
Diffstat (limited to 'CODINGSTYLE.md')
-rw-r--r--CODINGSTYLE.md22
1 files changed, 11 insertions, 11 deletions
diff --git a/CODINGSTYLE.md b/CODINGSTYLE.md
index 3d44642e106..ba1d27da6e2 100644
--- a/CODINGSTYLE.md
+++ b/CODINGSTYLE.md
@@ -6,7 +6,7 @@ and thus the quality of Alpine Linux, we kindly ask to follow these
recommendations.
## Language
-Alpine Linux APKBUILD files are inherently just POSIX shell scripts. Try avoid
+Alpine Linux APKBUILD files are inherently just POSIX shell scripts. Please avoid
extensions, even if they work or are accepted by busybox ash. (using keyword
`local` is an exception)
@@ -14,8 +14,8 @@ extensions, even if they work or are accepted by busybox ash. (using keyword
Use snake_case. Functions, variables etc. should be lower-cased with
underscores to separate words.
-Local 'private' variables and functions n global scope should be pre-fixed
-with a single underscore to avoid nameclash with internal variables in
+Local 'private' variables and functions in global scope should be prefixed
+with a single underscore to avoid name collisions with internal variables in
`abuild`.
Double underscores are reserved and should not be used.
@@ -24,7 +24,7 @@ _my_variable="data"
```
### Bracing
-Curly braces for functions are on the same line.
+Curly braces for functions should be on the same line.
```sh
prepare() {
@@ -32,7 +32,7 @@ prepare() {
}
```
-Markers to indicate a compound statement, are on the same line.
+Markers to indicate a compound statement should be on the same line.
#### if ...; then
@@ -52,7 +52,7 @@ Markers to indicate a compound statement, are on the same line.
#### for ...; do
```sh
- for ...; do
+ for x in foo bar baz; do
...
done
```
@@ -60,13 +60,13 @@ Markers to indicate a compound statement, are on the same line.
### Spacing
All keywords and operators are separated by a space.
-For cleanliness sake, make sure there is however never any trailing whitespace.
+For cleanliness sake, ensure there is no trailing whitespace.
## Identation
-Indentation is one tab character, alignment is done using spaces. For example
-using the >------- characters to indicate a tab:
+Indentation is one tab character per level, alignment is done using spaces.
+For example (using the >------- characters to indicate a tab):
```sh
-prepare()
+build()
{
>-------make DESTDIR="${pkgdir}" \
>------- PREFIX="/usr"
@@ -99,7 +99,7 @@ foo_bar="$foo"
```
## Subshell usage
-Use `$()` syntax, not backticks, as backticks are hard to spot.
+Use `$()` syntax, not backticks.
## Sorting
Some items tend to benefit from being sorted. A list of sources, dependencies