TODO: Expand beyond naming and formatting
.cpp/.mm and .c/.m should have extension .h.cpp/.mm only should have extension .hpp*.c, *.cpp, *.m, *.mm). Use fully qualified names for definitions.extern "C" blocks inside implementation files.namespace kotlinnamespace kotlin in a nested namespace [module_name].h/.hpp into a nested namespace internal (e.g. implementation details of module mm go into namespace kotlin { namespace mm { namespace internal { ... } } }).cpp/.mm into a global anonymous namespaceextern "C" declarations emulate namespaces with Kotlin_[module_name]_ prefixes.kotlin::MoveOnlykotlin::PinnedKonanAllocatorAwareKStd* containers and smart pointers instead of std::* ones.PascalCasecamelCasecamelCasekPascalCase (with prefix k)camelCasePascalCasecamelCase. Private member fields should add _ suffix: camelCase_camelCaseSCREAMING_SNAKE_CASEsnake_caseenum and enum class members should use kPascalCaseIf API is designed to mimic C++ stdlib (e.g. stubbing <atomic> for platforms that do not support it), its allowed to follow stdlib naming conventions.
For automated formatting you can use config for CLion or clang-format (see config at the repo's root). Note, that CLion uses clang-format by default; this can be turned off if you prefer to use rules from CLionFormat.xml.
Formatting rules are designed to closely mirror Kotlin rules.
* and & should be placed on a type instead of a variable* at all.template and <