Skip to content

Commit aaef0e2

Browse files
committed
Added Contribution guidelines, Updated README [ci skip]
1 parent b19aa30 commit aaef0e2

File tree

2 files changed

+146
-15
lines changed

2 files changed

+146
-15
lines changed

CONTRIBUTING.md

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# Contributing
2+
3+
The following are few guidelines and answers intended for contributors
4+
5+
## What can i contribute ?
6+
7+
you can contribute by making one of those:
8+
* Report a bug ([jump](#bug))
9+
* Suggest a feature ([jump](#feature))
10+
* Code a change (this should be first suggested) ([jump](#code-change))
11+
12+
## How can i contribute ?
13+
14+
### <a id='bug'></a>Reporting a bug
15+
16+
Bugs are reported at the [issue tracker]
17+
18+
If you think you found a bug:
19+
* Check the [issue tracker]
20+
* If you did find a relevant post about the problem: bring details or an upvote (even in closed issue)
21+
* if you didn't find a relevant post then you can create a new issue
22+
* The title should be relevant, explaining the problem in few words, avoid uppercases letters
23+
* The issue should be very detailed, explaining how to reproduce the bug, containing anything that you think useful in order to fix it
24+
25+
### <a id='feature'></a>Suggesting a feature
26+
27+
Features are also welcome but there are few things to take into account.
28+
29+
* Features are also tracked [here](https://github.com/tonykero/Moe/issues), check it before suggesting a feature in order to avoid duplicates.
30+
* Features should be relevant to the Moe library, you don't want to see a machine-learning library with a built-in currency converter
31+
* Feature suggestions are discussions, but don't depend on a general agreement
32+
33+
### <a id='code-change'></a>Making changes
34+
35+
Code contributions are more than welcome!
36+
37+
* Check for duplicates [here](https://github.com/tonykero/Moe/pulls)
38+
* Use [pull requests] in order to submit a change
39+
* Follow [code style guidelines](#coding-style)
40+
* Dependencies should be optional (#define / CMake Option)
41+
* Commit on a disctinct branch
42+
* If your contribution fix an issue, it should preferably only fix one or closely related ones
43+
* Explain and comment your code
44+
45+
## <a id='coding-style'></a>Coding Style
46+
47+
The following is the coding style used in Moe
48+
49+
### Naming
50+
51+
---
52+
53+
Variables naming is in lowerCamelCase
54+
```cpp
55+
unsigned int moesCount;
56+
```
57+
> we need a basic style to start with
58+
59+
---
60+
61+
Members variables are also written in lowerCamelCase, but have a 'm_' prefix
62+
```cpp
63+
std::string m_id;
64+
```
65+
> to distinguish them from function-scoped variables
66+
67+
---
68+
69+
Arguments have a '_' prefix
70+
```cpp
71+
void run( unsigned int _generations );
72+
```
73+
> to distinguish them from members, notably in setters
74+
75+
---
76+
77+
Then classes are written in UpperCamelCase, with first public members then private members
78+
```cpp
79+
class UltraPowerfulAlgorithm : public PowerfulAlgorithm
80+
{
81+
public:
82+
void run( unsigned int _generations );
83+
84+
private:
85+
unsigned int m_generations;
86+
};
87+
```
88+
> note braces placement
89+
90+
### Indentation
91+
92+
Indentations should be 4-space long
93+
94+
also if you have multiple variables declarations:
95+
```cpp
96+
unsigned int m_moesPerGen;
97+
unsigned int m_generations;
98+
```
99+
should be
100+
```cpp
101+
unsigned int m_moesPerGen,
102+
m_generations;
103+
```
104+
105+
### Other points:
106+
* Keep naming simple: 3 words max
107+
* There is no file naming rule
108+
* No forward-declaration
109+
* Keep header-only
110+
* Keep dependency-free (or optional dependencies)
111+
* Keep platform independent
112+
113+
Parsing the source in order to be confident with the coding style is recommended.
114+
115+
[pull requests]: https://github.com/tonykero/Moe/pulls
116+
[issue tracker]: https://github.com/tonykero/Moe/issues

README.md

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -68,22 +68,19 @@ Moe contains the following features:
6868

6969
* Algorithms:
7070
* Genetic Algorithm
71+
* Crossovers:
72+
* One Point
73+
* Two Point
74+
* Uniform
75+
* Mutations:
76+
* Substitution
77+
* Insertion
78+
* Deletion
79+
* Translocation
7180
* Differential Evolution
7281
* Particle Swarm Optimization
7382
* + Abstract Classes
7483

75-
* Genetic Algorithm features:
76-
* Crossovers:
77-
* One Point
78-
* Two Point
79-
* Uniform
80-
81-
* Mutations:
82-
* Substitution
83-
* Insertion
84-
* Deletion
85-
* Translocation
86-
8784
* Planned:
8885
* Performance:
8986
* Parallel Implementation
@@ -100,7 +97,7 @@ BUILD_EXAMPLES | Builds Examples | ON |
10097
BUILD_TESTS | Builds Catch Unit Tests | OFF |
10198
DEBUG | Enables debugging symbols | OFF |
10299

103-
Moe was(and still) successfully tested against:
100+
Moe is successfully tested against:
104101
* GCC:
105102
* 5 (5.4.1)
106103
* 6 (6.2)
@@ -119,13 +116,31 @@ Moe was(and still) successfully tested against:
119116
120117
Compiling:
121118

119+
The following clone Moe and generates with CMake
122120
```
123121
git clone https://github.com/tonykero/Moe.git
124122
cd Moe
125-
mkdir build && cd build && cmake .. && cmake --build .
123+
mkdir build && cd build && cmake ..
124+
```
125+
then under linux
126+
```
127+
make
128+
```
129+
or
130+
```
131+
cmake --build .
126132
```
127-
builds Moe with examples
133+
or (if with MSVC, and -DDEBUG=1 was not specified)
134+
```
135+
cmake --build . --config Release
136+
```
137+
138+
## Contributing
139+
140+
Please read [Contributing](https://github.com/tonykero/Moe/blob/master/CONTRIBUTING.md)
128141

129142
## License
130143

131144
[The MIT License](https://opensource.org/licenses/MIT)
145+
146+
> Note: 'tests' folder contains catch.hpp which comes from <https://github.com/philsquared/Catch> and is licensed under the Boost Software License terms.

0 commit comments

Comments
 (0)