aboutsummaryrefslogtreecommitdiff
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)
downloadalpine_aports-36151e1e21aaff5cd0f602eeaebf5d741ff6c2e9.tar.bz2
alpine_aports-36151e1e21aaff5cd0f602eeaebf5d741ff6c2e9.tar.xz
alpine_aports-36151e1e21aaff5cd0f602eeaebf5d741ff6c2e9.zip
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 3d44642e10..ba1d27da6e 100644
--- a/CODINGSTYLE.md
+++ b/CODINGSTYLE.md
@@ -6,7 +6,7 @@ and thus the quality of Alpine Linux, we kindly ask to follow these
6recommendations. 6recommendations.
7 7
8## Language 8## Language
9Alpine Linux APKBUILD files are inherently just POSIX shell scripts. Try avoid 9Alpine Linux APKBUILD files are inherently just POSIX shell scripts. Please avoid
10extensions, even if they work or are accepted by busybox ash. (using keyword 10extensions, even if they work or are accepted by busybox ash. (using keyword
11`local` is an exception) 11`local` is an exception)
12 12
@@ -14,8 +14,8 @@ extensions, even if they work or are accepted by busybox ash. (using keyword
14Use snake_case. Functions, variables etc. should be lower-cased with 14Use snake_case. Functions, variables etc. should be lower-cased with
15underscores to separate words. 15underscores to separate words.
16 16
17Local 'private' variables and functions n global scope should be pre-fixed 17Local 'private' variables and functions in global scope should be prefixed
18with a single underscore to avoid nameclash with internal variables in 18with a single underscore to avoid name collisions with internal variables in
19`abuild`. 19`abuild`.
20 20
21Double underscores are reserved and should not be used. 21Double underscores are reserved and should not be used.
@@ -24,7 +24,7 @@ _my_variable="data"
24``` 24```
25 25
26### Bracing 26### Bracing
27Curly braces for functions are on the same line. 27Curly braces for functions should be on the same line.
28 28
29```sh 29```sh
30prepare() { 30prepare() {
@@ -32,7 +32,7 @@ prepare() {
32} 32}
33``` 33```
34 34
35Markers to indicate a compound statement, are on the same line. 35Markers to indicate a compound statement should be on the same line.
36 36
37 37
38#### if ...; then 38#### if ...; then
@@ -52,7 +52,7 @@ Markers to indicate a compound statement, are on the same line.
52 52
53#### for ...; do 53#### for ...; do
54```sh 54```sh
55 for ...; do 55 for x in foo bar baz; do
56 ... 56 ...
57 done 57 done
58``` 58```
@@ -60,13 +60,13 @@ Markers to indicate a compound statement, are on the same line.
60### Spacing 60### Spacing
61All keywords and operators are separated by a space. 61All keywords and operators are separated by a space.
62 62
63For cleanliness sake, make sure there is however never any trailing whitespace. 63For cleanliness sake, ensure there is no trailing whitespace.
64 64
65## Identation 65## Identation
66Indentation is one tab character, alignment is done using spaces. For example 66Indentation is one tab character per level, alignment is done using spaces.
67using the >------- characters to indicate a tab: 67For example (using the >------- characters to indicate a tab):
68```sh 68```sh
69prepare() 69build()
70{ 70{
71>-------make DESTDIR="${pkgdir}" \ 71>-------make DESTDIR="${pkgdir}" \
72>------- PREFIX="/usr" 72>------- PREFIX="/usr"
@@ -99,7 +99,7 @@ foo_bar="$foo"
99``` 99```
100 100
101## Subshell usage 101## Subshell usage
102Use `$()` syntax, not backticks, as backticks are hard to spot. 102Use `$()` syntax, not backticks.
103 103
104## Sorting 104## Sorting
105Some items tend to benefit from being sorted. A list of sources, dependencies 105Some items tend to benefit from being sorted. A list of sources, dependencies