Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
aports
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bart Ribbers
aports
Commits
36151e1e
Commit
36151e1e
authored
5 years ago
by
Simon F
Committed by
Natanael Copa
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Update CODINGSTYLE.md
Spotted some minor typos, improved some wordings
parent
1926d74a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CODINGSTYLE.md
+11
-11
11 additions, 11 deletions
CODINGSTYLE.md
with
11 additions
and
11 deletions
CODINGSTYLE.md
+
11
−
11
View file @
36151e1e
...
@@ -6,7 +6,7 @@ and thus the quality of Alpine Linux, we kindly ask to follow these
...
@@ -6,7 +6,7 @@ and thus the quality of Alpine Linux, we kindly ask to follow these
recommendations.
recommendations.
## Language
## 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
extensions, even if they work or are accepted by busybox ash. (using keyword
`local`
is an exception)
`local`
is an exception)
...
@@ -14,8 +14,8 @@ extensions, even if they work or are accepted by busybox ash. (using keyword
...
@@ -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
Use snake_case. Functions, variables etc. should be lower-cased with
underscores to separate words.
underscores to separate words.
Local 'private' variables and functions n global scope should be pre
-
fixed
Local 'private' variables and functions
i
n global scope should be prefixed
with a single underscore to avoid name
clash
with internal variables in
with a single underscore to avoid name
collisions
with internal variables in
`abuild`
.
`abuild`
.
Double underscores are reserved and should not be used.
Double underscores are reserved and should not be used.
...
@@ -24,7 +24,7 @@ _my_variable="data"
...
@@ -24,7 +24,7 @@ _my_variable="data"
```
```
### Bracing
### Bracing
Curly braces for functions
ar
e on the same line.
Curly braces for functions
should b
e on the same line.
```
sh
```
sh
prepare
()
{
prepare
()
{
...
@@ -32,7 +32,7 @@ prepare() {
...
@@ -32,7 +32,7 @@ prepare() {
}
}
```
```
Markers to indicate a compound statement
, ar
e on the same line.
Markers to indicate a compound statement
should b
e on the same line.
#### if ...; then
#### if ...; then
...
@@ -52,7 +52,7 @@ Markers to indicate a compound statement, are on the same line.
...
@@ -52,7 +52,7 @@ Markers to indicate a compound statement, are on the same line.
#### for ...; do
#### for ...; do
```
sh
```
sh
for
...
;
do
for
x
in
foo bar baz
;
do
...
...
done
done
```
```
...
@@ -60,13 +60,13 @@ Markers to indicate a compound statement, are on the same line.
...
@@ -60,13 +60,13 @@ Markers to indicate a compound statement, are on the same line.
### Spacing
### Spacing
All keywords and operators are separated by a space.
All keywords and operators are separated by a space.
For cleanliness sake,
make
sure there is
however never any
trailing whitespace.
For cleanliness sake,
en
sure there is
no
trailing whitespace.
## Identation
## Identation
Indentation is one tab character, alignment is done using spaces.
For example
Indentation is one tab character
per level
, alignment is done using spaces.
using the >------- characters to indicate a tab:
For example (
using the >------- characters to indicate a tab
)
:
```
sh
```
sh
prepare
()
build
()
{
{
>
-------make
DESTDIR
=
"
${
pkgdir
}
"
\
>
-------make
DESTDIR
=
"
${
pkgdir
}
"
\
>
-------
PREFIX
=
"/usr"
>
-------
PREFIX
=
"/usr"
...
@@ -99,7 +99,7 @@ foo_bar="$foo"
...
@@ -99,7 +99,7 @@ foo_bar="$foo"
```
```
## Subshell usage
## Subshell usage
Use
`$()`
syntax, not backticks
, as backticks are hard to spot
.
Use
`$()`
syntax, not backticks.
## Sorting
## Sorting
Some items tend to benefit from being sorted. A list of sources, dependencies
Some items tend to benefit from being sorted. A list of sources, dependencies
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment