Development
User binaries can be built with minimal requirements, however additional tools are required for style enforcement and building documentation locally. Most packages - but not all - are available through pip. Pip is recommended over conda to ensure latest packages. For the most-recent examples see the CI/CD pipeline (e.g. before-script commands in .gitlab-ci.yml).
Recommended Dependencies
External : cmake, clang-format (e.g. distributed with llvm), and doxygen.
Within a python virtual environment:
Pre-Commit Hooks
Pre-commit hooks are automatically evaluated in the CI/CD pipeline according to the configuration file .pre-commit-config.yaml. These checks can be run locally, once pre-commit is installed (e.g. pip above), by installing the git-hook scripts
Building Documentation
Documentation is published using mkdocs-material, doxygen, and mkdoxy. Website style and navigation are configured in mkdocs.yml, while site content are stored in .\docs\.
Publishing documentation locally
Docs can be generated and hosted locally using
Documentation is automatically published through CI/CD.Publishing MATLAB demos
Since R2023b, Live Scripts can be published to markdown directly. To publish Live Scripts in the matlab subfolder, to the doc/demos subfolder as markdown, use
| publish to markdown | |
|---|---|
Style Guides & Enforcement
Aspirational style guides and enforcement. :)
| Language | Guides | Enforcement |
|---|---|---|
| C/C++ | Google, Cpp Core | clang-format |
| Python | Pep8 | Black |
| MATLAB | FileExchange | MISS_HIT |
House-style
-
include guard: use
#pragma once, not#ifndef. -
Naming conventions
snake_case(lower case, underscore delimited) for variables, files, namespacesUpperCamelCase(capitalize first and each word) for classes and typesALL_CAPSfor macros andstatic constexpr.- Organization
- Subfolders under
Ennuicorrespond with namespaces. C++ namespaces correspond with packages in both python and MATLAB. Each file may warrant an additional namespace. For example, a collection of functions. - Use using-declarations, not using-directives.
- API Design
- For internal C++ functions, favor return by value and rely on named returned value optimization (NRVO).
- For external interfaces, favor return by reference to avoid memcopies in C.
- C++ Documentation vs Comments
- Use doxygen-compatible comment blocks to document all public and protected C++ components
- Multi-line blocks: /** */
- Single-line documentation: //!
- Comments (not to appear in documentation), use single line comments: //, or C++ style /* */