Skip to content

feat: Add .editorconfig, .gitignore, and .vscode/extensions.json files #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs.
# Atom: Please assure your Atom's config setting Tab Type is set to auto, otherwise Atom-EditorConfig may not work as expected. Also disable whitespace package.
# http://editorconfig.org/

root = true

[*]
charset = utf-8
indent_style = tab
indent_size = 4
trim_trailing_whitespace = true
end_of_line = lf
insert_final_newline = true

# MARKDOWN Files
[*.{md}]
indent_style = space
indent_size = 4
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.vscode/settings.json
35 changes: 35 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"no-duplicate-heading": false,
"no-inline-html": {
"allowed_elements": [
"figure",
"figcaption",
"img",
"p"
]
},
"no-bare-urls": false,
"comment": "The following entries disable rules that may conflict with Prettier see https://github.com/DavidAnson/markdownlint/blob/v0.34.0/style/prettier.json",
"blanks-around-fences": false,
"blanks-around-headings": false,
"blanks-around-lists": false,
"code-fence-style": false,
"emphasis-style": false,
"heading-start-left": false,
"hr-style": false,
"line-length": false,
"list-indent": false,
"list-marker-space": false,
"no-blanks-blockquote": false,
"no-hard-tabs": false,
"no-missing-space-atx": false,
"no-missing-space-closed-atx": false,
"no-multiple-blanks": false,
"no-multiple-space-atx": false,
"no-multiple-space-blockquote": false,
"no-multiple-space-closed-atx": false,
"no-trailing-spaces": false,
"ol-prefix": false,
"strong-style": false,
"ul-indent": false
}
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"editorconfig.editorconfig",
"yzhang.markdown-all-in-one",
"DavidAnson.vscode-markdownlint",
"esbenp.prettier-vscode"
]
}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

The command-line tool for quick, simple deployment and management of Linux dedicated game servers.

* User docs: [docs.linuxgsm.com](https://docs.linuxgsm.com)
* Dev Docs: [dev-docs.linuxgsm.com](https://dev-docs.linuxgsm.com)
- User docs: [docs.linuxgsm.com](https://docs.linuxgsm.com)
- Dev Docs: [dev-docs.linuxgsm.com](https://dev-docs.linuxgsm.com)

## Introduction

Welcome to the LinuxGSM developer documentation that covers how to get started, tooling, workflow, best practices, and code standards.

If you want to contribute to LinuxGSM and need assistance feel free to pop on the LinuxGSM [Discord ](https://linuxgsm.com/discord)and have a chat with some of the contributors.
If you want to contribute to LinuxGSM and need assistance feel free to pop on the LinuxGSM [Discord](https://linuxgsm.com/discord)and have a chat with some of the contributors.

## Work in Progress

Expand Down
60 changes: 30 additions & 30 deletions SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
# Table of contents

* [Home](README.md)
- [Home](README.md)

## Getting Started

* [Getting Started](getting-started/feature-development-quick-guide.md)
* [Programming Language](getting-started/programming-language.md)
* [Development Software](getting-started/development-software.md)
* [Test Environment](getting-started/test-environment.md)
* [Developer Commands](getting-started/developer-commands.md)
* [Adding a new Game Server](getting-started/adding-a-new-game-server.md)
- [Getting Started](getting-started/feature-development-quick-guide.md)
- [Programming Language](getting-started/programming-language.md)
- [Development Software](getting-started/development-software.md)
- [Test Environment](getting-started/test-environment.md)
- [Developer Commands](getting-started/developer-commands.md)
- [Adding a new Game Server](getting-started/adding-a-new-game-server.md)

## Workflow

* [Semantic Versioning](workflow/semantic-versioning.md)
* [Workflow](workflow/workflow.md)
* [Agile](workflow/agile.md)
* [Pull Requests](workflow/branching.md)
* [Gitflow](workflow/gitflow.md)
* [Conventional Commits](workflow/conventional-commits.md)
* [Unit Tests](workflow/unit-tests.md)
- [Semantic Versioning](workflow/semantic-versioning.md)
- [Workflow](workflow/workflow.md)
- [Agile](workflow/agile.md)
- [Pull Requests](workflow/branching.md)
- [Gitflow](workflow/gitflow.md)
- [Conventional Commits](workflow/conventional-commits.md)
- [Unit Tests](workflow/unit-tests.md)

## Technical

* [Main Executable](technical/main-executable.md)
* [Commands](technical/commands.md)
* [Exit Codes](technical/exit-codes.md)
* [Functions](technical/functions.md)
* [Modules](technical/modules.md)
* [Fixes](technical/modules/fixes.md)
* [Core](technical/modules/core.md)
* [Game Server Querying](technical/game-server-querying.md)
* [Messages & Logs](technical/messages-and-logs.md)
* [Checks](technical/checks.md)
* [Exit](technical/exit.md)
* [Install](technical/install.md)
* [Debuggins](technical/debuggins.md)
- [Main Executable](technical/main-executable.md)
- [Commands](technical/commands.md)
- [Exit Codes](technical/exit-codes.md)
- [Functions](technical/functions.md)
- [Modules](technical/modules.md)
- [Fixes](technical/modules/fixes.md)
- [Core](technical/modules/core.md)
- [Game Server Querying](technical/game-server-querying.md)
- [Messages & Logs](technical/messages-and-logs.md)
- [Checks](technical/checks.md)
- [Exit & Exit Codes](technical/exit-codes.md)
- [Install](technical/install.md)
- [Debuggins](technical/debuggins.md)

## Code Standards

* [Style Guide](code-standards/style-guide.md)
* [Shellcheck Linter](code-standards/shellcheck-linter.md)
* [Text Editor Settings](code-standards/text-editor-settings.md)
- [Style Guide](code-standards/style-guide.md)
- [Shellcheck Linter](code-standards/shellcheck-linter.md)
- [Text Editor Settings](code-standards/text-editor-settings.md)
3 changes: 1 addition & 2 deletions code-standards/shellcheck-linter.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Shellcheck Linter

\[WIP\]

[WIP]
64 changes: 32 additions & 32 deletions code-standards/style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Here are some of them.

## Variables

#### Naming variables
### Naming variables

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).

Expand All @@ -25,7 +25,7 @@ Variable should always be called between brackets and double quotes to prevent g
echo "${var}"
```

### Directories
## Directories

Directories are called using LinuxGSM directories variables, or relative to those. Common directory variables can be found in `linuxgsm.sh` and `_default.cfg` .

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

If statements should look like the following

```
```bash
if [ "${shortname}" == "csgo" ];then
# content
fi
```

if statements with multiple options like so

```
```bash
if [ "${shortname}" == "csgo" ]||[ "${shortname}" == "css" ]; then
# content
fi
Expand All @@ -60,9 +60,9 @@ fi

### Syntax

* The `if [ statement ]; then` should be a one-liner operation.
* Signs comparators like `==`, `lt`, `lt` etc. are preferred to `-eq`, `-le`, `-lt`.
* Anything within an if statement must be tabulated one step deeper.
- The `if [ statement ]; then` should be a one-liner operation.
- Signs comparators like `==`, `lt`, `lt` etc. are preferred to `-eq`, `-le`, `-lt`.
- Anything within an if statement must be tabulated one step deeper.

Example:

Expand All @@ -74,7 +74,7 @@ fi

### Expression Standards

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

| Expression | Description |
| ---------- | ------------------------------------ |
Expand Down Expand Up @@ -109,7 +109,7 @@ if [ -z "${var}" ]; then
fi
```

```
```bash
var=""
# OR
var="set"
Expand All @@ -118,7 +118,7 @@ if [ -v var ]; then
fi
```

```
```bash
# var is missing
if [ ! -v var ]; then
# Variable does not exist
Expand All @@ -127,8 +127,8 @@ fi

## Loops

* Loops should be a one liner statement.
* Anything within a loop must be tabulated one step deeper.
- Loops should be a one liner statement.
- Anything within a loop must be tabulated one step deeper.

```bash
while [ "${var}" < "${cap}" ]; do
Expand All @@ -139,17 +139,17 @@ done

## Comments

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.
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.

```bash
# Using comments help developers understand complex code, but should be used sparingly.
```

## Functions

* Function should be named starting with `fn_` and using lowercase letters only.
* Any recurrent task should be put into a function.
* Anything within a function must be tabulated one step deeper.
- Function should be named starting with `fn_` and using lowercase letters only.
- Any recurrent task should be put into a function.
- Anything within a function must be tabulated one step deeper.

Example:

Expand All @@ -161,56 +161,56 @@ fn_myfunction(){

## Messages

* Messages should be given using core\_messages.sh forms
* Additional information messages are given in the form of `echo -e " * Message here"`
- Messages should be given using core_messages.sh forms
- Additional information messages are given in the form of `echo -e " * Message here"`

## Automated Messages

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.
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](../technical/exit-codes.md) for details.

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

`fn_print_dots`
### `fn_print_dots`

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

```text
[ .... ] Starting fctrserver:
```

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

fn\_print\_ok

```
```text
[ OK ] Starting fctrserver: Factorio Server
```

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.

```
```text
[ OK ] Stopping fctrserver: Graceful: CTRL+c: 2: OK
[ .... ] Starting fctrserver: Factorio Server
```

#### Characteristics
### Characteristics of Automated Messages

Interactive messages contain extra detail at the begining of the message that is pre-populated. Full stops must `not` be used with this type of message.
Automated messages contain extra detail at the begining of the message that is pre-populated. Full stops must `not` be used with this type of message.

### Interactive Messages
## Interactive Messages

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.

```
```text
Warning! If fctrserver is already running it will be stopped.
```

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

```
```bash
Information! Press "CTRL+b" then "d" to exit console.
Warning! Do NOT press CTRL+c to exit.
* https://docs.linuxgsm.com/commands/console
```

#### Characteristics
### Characteristics of Interactive Messages

Treat interactive messages as a standard sentence. All messages must begin with a capital and end with a full stop
4 changes: 2 additions & 2 deletions code-standards/text-editor-settings.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: '[WIP] discuss using LF and white space remover etc.'
description: "[WIP] discuss using LF and white space remover etc."
---

# Text Editor Settings
Expand All @@ -20,7 +20,7 @@ For more info about line endings check out the article "[The Great Newline Schis

When developing code sometimes it can be easy to end up with trailing white spaces. as shown below.

```
```bash
fn_example_func(){
# The line below has two spaces after its final character
code••
Expand Down
Loading