Skip to content

Commit 0620a2a

Browse files
dgibbs64gitbook-bot
authored andcommitted
GITBOOK-33: change request with no subject merged in GitBook
1 parent 8638f23 commit 0620a2a

File tree

6 files changed

+34
-37
lines changed

6 files changed

+34
-37
lines changed

SUMMARY.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
## Getting Started
77

8+
* [Getting Started](getting-started/feature-development-quick-guide.md)
89
* [Development Software](getting-started/development-software.md)
910
* [Test Environment](getting-started/test-environment.md)
1011
* [Developer Commands](getting-started/developer-commands.md)
@@ -18,22 +19,19 @@
1819
* [Agile](workflow/agile.md)
1920
* [Pull Requests](workflow/branching.md)
2021
* [Gitflow](workflow/gitflow.md)
21-
* [Conventional Commits](code-standards/conventional-commits.md)
22+
* [Conventional Commits](workflow/conventional-commits.md)
23+
* [Unit Tests](workflow/unit-tests.md)
2224

2325
## Technical
26+
2427
* [Commands](technical/commands.md)
2528
* [Exit Codes](technical/exit-codes.md)
2629
* [Functions](technical/functions.md)
2730
* [Modules](technical/modules.md)
31+
* [Game Server Querying](technical/game-server-querying.md)
2832

2933
## Code Standards
3034

3135
* [Style Guide](code-standards/style-guide.md)
3236
* [Shellcheck Linter](code-standards/shellcheck-linter.md)
3337
* [Text Editor Settings](code-standards/text-editor-settings.md)
34-
35-
***
36-
37-
* [Game Server Querying](game-server-querying.md)
38-
* [Unit Tests](unit-tests.md)
39-
* [Getting Started](feature-development-quick-guide.md)

code-standards/style-guide.md

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Style Guide
22

3-
In order to make LinuxGSM as coherent as possible, we adopted some code conventions to follow.
3+
In order to make LinuxGSM as coherent as possible, we adopted some code conventions to follow.\
44
Here are some of them.
55

66
## Variables
77

88
#### Naming variables
99

10-
Variables should be made of lowercase letters only and should be descriptive enough to understand its purpose \(even if the variable is longer that preferred\).
10+
Variables should be made of lowercase letters only and should be descriptive enough to understand its purpose (even if the variable is longer that preferred).
1111

1212
### Defining variables
1313

@@ -42,15 +42,15 @@ find "${executabledir}/bin"
4242

4343
If statements should look like the following
4444

45-
```text
45+
```
4646
if [ "${shortname}" == "csgo" ];then
4747
# content
4848
fi
4949
```
5050

5151
if statements with multiple options like so
5252

53-
```text
53+
```
5454
if [ "${shortname}" == "csgo" ]||[ "${shortname}" == "css" ]; then
5555
# content
5656
fi
@@ -74,26 +74,26 @@ fi
7474

7575
### Expression Standards
7676

77-
Common if expressions LinuxGSM uses. More expressions [here](http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_01.html).
77+
Common if expressions LinuxGSM uses. More expressions [here](http://tldp.org/LDP/Bash-Beginners-Guide/html/sect\_07\_01.html).
7878

79-
| Expression | Description |
80-
| :--- | :--- |
81-
| `-d` | if directory exists |
82-
| `! -d` | if directory does not exist |
83-
| `-f` | if file exists |
84-
| `! -f` | if file does not exist |
85-
| `-z` | true if length of string is zero |
86-
| `-n` | true if length of string is non-zero |
87-
| `-v` | true if the variable exists |
79+
| Expression | Description |
80+
| ---------- | ------------------------------------ |
81+
| `-d` | if directory exists |
82+
| `! -d` | if directory does not exist |
83+
| `-f` | if file exists |
84+
| `! -f` | if file does not exist |
85+
| `-z` | true if length of string is zero |
86+
| `-n` | true if length of string is non-zero |
87+
| `-v` | true if the variable exists |
8888

8989
{% hint style="danger" %}
9090
Do not use `! -z` or `! -n`
9191
{% endhint %}
9292

93-
There is a distinct difference between -n and -v.
93+
There is a distinct difference between -n and -v.
9494

95-
-n is used to check is a variable is set and not if it exists
96-
-v is used to check if a variable exists and not it is set
95+
\-n is used to check is a variable is set and not if it exists\
96+
\-v is used to check if a variable exists and not it is set
9797

9898
```bash
9999
var="set"
@@ -109,7 +109,7 @@ if [ -z "${var}" ]; then
109109
fi
110110
```
111111

112-
```text
112+
```
113113
var=""
114114
# OR
115115
var="set"
@@ -118,7 +118,7 @@ if [ -v var ]; then
118118
fi
119119
```
120120

121-
```text
121+
```
122122
# var is missing
123123
if [ ! -v var ]; then
124124
# Variable does not exist
@@ -139,7 +139,7 @@ done
139139

140140
## Comments
141141

142-
As English is not always the native language of a developer, comments should use a formal writing style and be straight to the point. If unsure this short formal writing [guide](http://www2.ivcc.edu/rambo/tip_formal_writing_voice.htm) will help.
142+
As English is not always the native language of a developer, comments should use a formal writing style and be straight to the point. If unsure this short formal writing [guide](http://www2.ivcc.edu/rambo/tip\_formal\_writing\_voice.htm) will help.
143143

144144
```bash
145145
# Using comments help developers understand complex code, but should be used sparingly.
@@ -166,27 +166,27 @@ fn_myfunction(){
166166

167167
## Automated Messages
168168

169-
Automated messages are used with any commands that are non-interactive. Examples of this include Start, Stop and Monitor. There are various different alert messages available see [Exit-Codes](exit-codes.md) for details.
169+
Automated messages are used with any commands that are non-interactive. Examples of this include Start, Stop and Monitor. There are various different alert messages available see [Exit-Codes](broken-reference) for details.
170170

171171
Each automated message starts with `fn_print_dots` to show a process is happening but with no known outcome.
172172

173173
`fn_print_dots`
174174

175-
```text
175+
```
176176
[ .... ] Starting fctrserver:
177177
```
178178

179179
Once an outcome of a process is known the message uses an outcome message like `fn_print_ok` or `fn_print_fail`
180180

181181
fn\_print\_ok
182182

183-
```text
183+
```
184184
[ OK ] Starting fctrserver: Factorio Server
185185
```
186186

187187
The option of a newline is also available by appending `_nl` for example `fn_print_ok_nl`. This will add a carriage return to the message preventing it being overwritten by the next message.
188188

189-
```text
189+
```
190190
[ OK ] Stopping fctrserver: Graceful: CTRL+c: 2: OK
191191
[ .... ] Starting fctrserver: Factorio Server
192192
```
@@ -197,15 +197,15 @@ Interactive messages contain extra detail at the begining of the message that is
197197

198198
### Interactive Messages
199199

200-
Interactive messages are used with any commands that have interactive elements. Examples of this include Install, console and debug. There are various different alert messages available see \[\[Exit-Codes\]\] for details.
200+
Interactive messages are used with any commands that have interactive elements. Examples of this include Install, console and debug. There are various different alert messages available see \[\[Exit-Codes]] for details.
201201

202-
```text
202+
```
203203
Warning! If fctrserver is already running it will be stopped.
204204
```
205205

206206
standard echo commands are normally used to supplement an alert or if an alert is not required. Bullet points can also be used
207207

208-
```text
208+
```
209209
Information! Press "CTRL+b" then "d" to exit console.
210210
Warning! Do NOT press CTRL+c to exit.
211211
* https://docs.linuxgsm.com/commands/console
@@ -214,4 +214,3 @@ Warning! Do NOT press CTRL+c to exit.
214214
#### Characteristics
215215

216216
Treat interactive messages as a standard sentence. All messages must begin with a capital and end with a full stop
217-

getting-started/developing-linuxgsm.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ A user can also run the install again if they want multiple instances of the sam
2020

2121
## Modules
2222

23-
Modules are individual bash scripts containing code and functions that complete specific tasks. See the [modules](../code-standards/modules.md) page for more info.
23+
Modules are individual bash scripts containing code and functions that complete specific tasks. See the [modules](broken-reference) page for more info.
2424

2525
## Commands
2626

27-
Within LInuxGSM there are many commands that a user will run to complete tasks such as start, stop, monitor, and details. Command scripts are stored will all other modules and are always named something like `command_install.sh`. See the [commands](../code-standards/commands.md) page for more info.
27+
Within LInuxGSM there are many commands that a user will run to complete tasks such as start, stop, monitor, and details. Command scripts are stored will all other modules and are always named something like `command_install.sh`. See the [commands](broken-reference) page for more info.
2828

2929

3030

File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)