Skip to content

Commit

Permalink
more details added to CONTRIBUTING.md (#356)
Browse files Browse the repository at this point in the history
Former-commit-id: 4d13b4f8ea42a4df48346c9600b169fa122ce1da
  • Loading branch information
SuperFola committed Jan 20, 2022
1 parent 1cb9fa4 commit f3581ea
Showing 1 changed file with 27 additions and 9 deletions.
36 changes: 27 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!

Expand All @@ -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
Expand All @@ -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
/**
Expand Down Expand Up @@ -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>

Expand All @@ -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
Expand Down

0 comments on commit f3581ea

Please sign in to comment.