diff options
author | Simon F <simon@fraho.eu> | 2019-07-24 17:34:17 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2019-07-26 13:29:35 +0000 |
commit | 36151e1e21aaff5cd0f602eeaebf5d741ff6c2e9 (patch) | |
tree | ea07b285feeb07ccb1b6cb709f1fc331f6f331c1 /CODINGSTYLE.md | |
parent | 1926d74ad1256930c958bfe9a5308e8198e0fea5 (diff) | |
download | alpine_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.md | 22 |
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 | |||
6 | recommendations. | 6 | recommendations. |
7 | 7 | ||
8 | ## Language | 8 | ## Language |
9 | Alpine Linux APKBUILD files are inherently just POSIX shell scripts. Try avoid | 9 | Alpine Linux APKBUILD files are inherently just POSIX shell scripts. Please avoid |
10 | extensions, even if they work or are accepted by busybox ash. (using keyword | 10 | extensions, 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 | |||
14 | Use snake_case. Functions, variables etc. should be lower-cased with | 14 | Use snake_case. Functions, variables etc. should be lower-cased with |
15 | underscores to separate words. | 15 | underscores to separate words. |
16 | 16 | ||
17 | Local 'private' variables and functions n global scope should be pre-fixed | 17 | Local 'private' variables and functions in global scope should be prefixed |
18 | with a single underscore to avoid nameclash with internal variables in | 18 | with a single underscore to avoid name collisions with internal variables in |
19 | `abuild`. | 19 | `abuild`. |
20 | 20 | ||
21 | Double underscores are reserved and should not be used. | 21 | Double underscores are reserved and should not be used. |
@@ -24,7 +24,7 @@ _my_variable="data" | |||
24 | ``` | 24 | ``` |
25 | 25 | ||
26 | ### Bracing | 26 | ### Bracing |
27 | Curly braces for functions are on the same line. | 27 | Curly braces for functions should be on the same line. |
28 | 28 | ||
29 | ```sh | 29 | ```sh |
30 | prepare() { | 30 | prepare() { |
@@ -32,7 +32,7 @@ prepare() { | |||
32 | } | 32 | } |
33 | ``` | 33 | ``` |
34 | 34 | ||
35 | Markers to indicate a compound statement, are on the same line. | 35 | Markers 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 |
61 | All keywords and operators are separated by a space. | 61 | All keywords and operators are separated by a space. |
62 | 62 | ||
63 | For cleanliness sake, make sure there is however never any trailing whitespace. | 63 | For cleanliness sake, ensure there is no trailing whitespace. |
64 | 64 | ||
65 | ## Identation | 65 | ## Identation |
66 | Indentation is one tab character, alignment is done using spaces. For example | 66 | Indentation is one tab character per level, alignment is done using spaces. |
67 | using the >------- characters to indicate a tab: | 67 | For example (using the >------- characters to indicate a tab): |
68 | ```sh | 68 | ```sh |
69 | prepare() | 69 | build() |
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 |
102 | Use `$()` syntax, not backticks, as backticks are hard to spot. | 102 | Use `$()` syntax, not backticks. |
103 | 103 | ||
104 | ## Sorting | 104 | ## Sorting |
105 | Some items tend to benefit from being sorted. A list of sources, dependencies | 105 | Some items tend to benefit from being sorted. A list of sources, dependencies |