Note: These guidelines are a work in progress.
C++ code in this repository is formatted using ClangFormat to ensure consistency throughout the code base. Prettier is used for Markdown, JSON and YAML files.
A pre-commit configuration is included to run these tools automatically on commit. It’s recommended that you set it up locally. (However, a bot will also check and reformat pull requests if needed.)
Spaces (four per level) are used for indentation.
Unix newlines are always committed to the repo. (Git should automatically do this.)
Use UpperCamelCase for user-defined classes, types etc.
For functions and variables use lower_case_separated_by_underscores.
Static data and function members of classes are prefixed with s_.
Non-static data members are prefixed with m_.
(These prefixes can be omitted for simple data structures.)
British English is normally used both in names in code (class names, function names etc.) and in text in the UI. (An exception can be made for subclasses and instances of classes from other libraries.)
New code should not introduce additional warnings during builds.
Much of the code in the repo was written a long time ago, so it may not conform to the above naming conventions and should not necessarily be used as a guide for new code.