-
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
more details added to CONTRIBUTING.md (#356)
Former-commit-id: 4d13b4f8ea42a4df48346c9600b169fa122ce1da
- Loading branch information
Showing
1 changed file
with
27 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ You will find here a summary of the different things you should do / look up to | |
* HTTPS: `git clone https://github.com/<username>/Ark.git` | ||
* or SSH: `git clone [email protected]:<username>/Ark.git` | ||
* Create a branch for your feature: `git checkout -b feat/my-awesome-idea` | ||
* When you're done, push it to your fork and submit a pull request! | ||
* When you're done, push it to your fork and submit a pull request | ||
|
||
Don't know what to work on? No worries, we have a [list of things to do](https://github.com/ArkScript-lang/Ark/projects). Also, you can check the issues to find something to do! | ||
|
||
|
@@ -21,7 +21,7 @@ Don't know what to work on? No worries, we have a [list of things to do](https:/ | |
* Conditions with a single statement (`if (condition) do_this();`) do not need to be enclosed in braces | ||
* Put a space between `for`, `while`, `if` and `(...)`, around each `=` sign (wherever it is, even in for-loops), between `#include` and the file to include | ||
* Prefer `enum class` over `enum` | ||
* Case | ||
* Naming: | ||
* Methods and functions: camelCase | ||
* Variables: snake_case | ||
* Constant expressions: PascalCase | ||
|
@@ -47,9 +47,9 @@ for (std::size_t i = 0, end = container.size(); i < end; i++) | |
``` | ||
* Header-guards should be written using `#ifndef`, `#define` and `#endif`, the define being in MACRO_CASE | ||
* Functions and methods which can not throw exceptions must be marked `noexcept` | ||
* In header files, have a blank line between each method / function / structure / constant ; also put blanks line around includes blocks | ||
* In header files, have a blank line between each method / function / structure / constant ; also put blank lines around include blocks | ||
* In classes, avoid using `this`. Prefix every member variable with `m_` | ||
* In classes, do not declare the methods in the header file, only in the source file (unless they are `inline` or templated) | ||
* In classes, do not define the methods in the header file, only in the source file (unless they are `inline` or templated) | ||
* Add Doxygen file comments at the top of each newly created header file: | ||
```cpp | ||
/** | ||
|
@@ -81,10 +81,10 @@ Snippet to recapitulate guidelines for headers: | |
* @copyright Copyright (c) 2020 | ||
* | ||
*/ | ||
|
||
#ifndef HEADER_GUARD | ||
#define HEADER_GUARD | ||
|
||
#include <Ark/Compiler/Something.hpp> | ||
#include <vector> | ||
|
||
|
@@ -102,19 +102,37 @@ namespace Ark | |
* | ||
*/ | ||
Lexer(); | ||
|
||
/** | ||
* @brief doxygen documentation here | ||
* | ||
*/ | ||
void aMethod(); | ||
|
||
private: | ||
int m_member; ///< This is a doxygen comment | ||
}; | ||
} | ||
|
||
#endif | ||
#endif // Adding an empty line at the end of each file is strongly advised | ||
|
||
``` | ||
|
||
### Checking the enforcement of the coding style | ||
|
||
It is strongly advised to run clang-format on your code *before* submitting a pull request. | ||
|
||
You can do as follows if you are a Windows user: | ||
```powershell | ||
Function run-on { | ||
param ( | ||
$folder | ||
) | ||
Get-ChildItem -Path $folder -File -Recurse | Foreach {clang-format -style=file -i $_.fullname} | ||
} | ||
run-on .\include\Ark | ||
run-on .\src | ||
``` | ||
|
||
## ArkScript coding guidelines | ||
|