These coding conventions apply to all code and software written for the project and will constantly be extended as the project evolves and more code is written.
-
All lines in code files should not exceed 88 characters.
-
Names for modules, classes, methods and functions should be speaking and explicitly represent the content.
-
The use of global variables should be avoided where possible.
-
There should be no TODO-statements in released versions.
-
There should be no out commented code in released versions.
-
CI/CD should be implemented, if applicable.
-
All documentation should be provided in English.
-
A first overview of what the code in a repository does should be provided inside a
README.md. -
All parts of the public interface of modules, classes, methods and functions should provide detailed information in their headers about inputs, outputs and what is done.
-
A module/class header should at least provide information about authors, available functions and module-/class-parameters.
-
Function und method headers should provide information about authors, what and how it is done and in- and output parameters.
-
For in- and output parameters that are vectors or matrices, information on the dimensions should be provided.
-
Presentation of inputs and outputs should be consistent throughout one repository.
-
A function body should include a reasonable amount of commenting to provide a broad idea of what is happening at different points within the function.
-
If there are references to external sources in documenting comments, those should be consistently spread all over the project.
-
It is highly recommended that version number and release date be included in every release.
-
Git should be used during the whole process of software development for the project.
-
Commit early and often and publish your code as often as applicable to the open-source repository of the project.
-
Commit messages should be either Conventional Commit messages with a maximum line length of 100 characters or formatted as follows:
- First line is 50 characters or less and contains a brief description of the commit. It starts with a capital letter and does not end with a period. It finishes the sentence: "If applied, this commit will" your commit message
- If additional explanation is needed:
- Second line is a blank line.
- Remaining text should be wrapped at 72 characters and contains a detailed description of the commit.
These conventions are based on different community sources basically stating the same:
- Tim Pope (2008)
- Chris Beams (2014)
- Stephen Amaza (2017)
- https://stackoverflow.com/questions/2290016/
For examples look at the commit messages of this repository.