Skip to content

Latest commit

 

History

History
116 lines (85 loc) · 3.24 KB

CONTRIBUTING.md

File metadata and controls

116 lines (85 loc) · 3.24 KB

Contributing

The following are few guidelines and answers intended for contributors

What can i contribute ?

you can contribute by making one of those:

  • Report a bug (jump)
  • Suggest a feature (jump)
  • Code a change (this should be first suggested) (jump)

How can i contribute ?

Reporting a bug

Bugs are reported at the issue tracker

If you think you found a bug:

  • Check the issue tracker
    • If you did find a relevant post about the problem: bring details or an upvote (even in closed issue)
    • if you didn't find a relevant post then you can create a new issue
      • The title should be relevant, explaining the problem in few words, avoid uppercases letters
      • The issue should be very detailed, explaining how to reproduce the bug, containing anything that you think useful in order to fix it

Suggesting a feature

Features are also welcome but there are few things to take into account.

  • Features are also tracked here, check it before suggesting a feature in order to avoid duplicates.
  • Features should be relevant to the Moe library, you don't want to see a machine-learning library with a built-in currency converter
  • Feature suggestions are discussions, but don't depend on a general agreement

Making changes

Code contributions are more than welcome!

  • Check for duplicates here
  • Use pull requests in order to submit a change
  • Follow code style guidelines
  • Dependencies should be optional (#define / CMake Option)
  • Commit on a disctinct branch
  • If your contribution fix an issue, it should preferably only fix one or closely related ones
  • Explain and comment your code

Coding Style

The following is the coding style used in Moe

Naming


Variables naming is in lowerCamelCase

unsigned int moesCount;

we need a basic style to start with


Members variables are also written in lowerCamelCase, but have a 'm_' prefix

std::string m_id;

to distinguish them from function-scoped variables


Arguments have a '_' prefix

void run( unsigned int _generations );

to distinguish them from members, notably in setters


Then classes are written in UpperCamelCase, with first public members then private members

class UltraPowerfulAlgorithm : public PowerfulAlgorithm
{
    public:
        void run( unsigned int _generations );
    
    private:
        unsigned int m_generations;
};

note braces placement

Indentation

Indentations should be 4-space long

also if you have multiple variables declarations:

unsigned int m_moesPerGen;
unsigned int m_generations;

should be

unsigned int    m_moesPerGen,
                m_generations;

Other points:

  • Keep naming simple: 3 words max
  • There is no file naming rule
  • No forward-declaration
  • Keep header-only
  • Keep dependency-free (or optional dependencies)
  • Keep platform independent

Parsing the source in order to be confident with the coding style is recommended.