Contributing#
Development setup#
git clone git@github.com:tanh-lab/tanh-lib.git
cd tanh-lib
just build # cmake --preset desktop-debug && build
just test # + ctest
just (just --list) wraps the everyday recipes: format /
format-check, tidy / tidy-fix, test-filter PATTERN,
test-install, docs and the iOS configure/build recipes.
Naming conventions#
Enforced by .clang-tidy.
Classes/structs/enums/unions:
PascalCaseMethods/functions:
snake_caseMember variables:
m_prefix +snake_case, e.g.m_frequency_rangeLocal variables/parameters:
snake_caseConstants (
constexpr,static const, globalconst):k_prefix +snake_case, e.g.k_max_grainsEnum values:
PascalCase, e.g.ResonatorModal,LFOWaveform::SineMacros:
ALL_CAPS_WITH_UNDERSCORES, e.g.TANH_NONBLOCKING_FUNCTIONFolders:
kebab-case, e.g.audio-ioJSON keys exposed to JS/TS:
camelCase— C++ code emitting JSON for the JS bridge must use camelCase keys to match the TypeScript interfaces
Code style#
.clang-format (Google-based: 100-character lines, 4-space indent, K&R
braces) and .clang-tidy are enforced in the merge queue.
Tests#
test/ mirrors the components: test/core, test/state, test/dsp,
test/modulation and test/audio-io each build one test_* binary, and
test/exports and test/install check the packaging contracts. Run one
suite directly:
./build/desktop/Debug/test/dsp/test_dsp --gtest_filter="TestSuite.TestName"
The Rings resonator tests compare against reference fixtures that are not checked in; without them those tests are skipped (see Getting Started).
Every process() path is covered by the RealtimeSanitizer preset; see
Real-Time Safety.
CI#
Pull requests run the fast desktop tier; the merge queue runs every leg:
desktop build and test on Linux, macOS and Windows, iOS and Android, the
WebAssembly build, the install-tree consumer, the sanitizer presets,
clang-format, clang-tidy and the tanh-tooling drift check. All workflows call
the shared actions in tanh-lab/ci-actions and must pin the same version;
build_test’s result job asserts that.
Documentation#
Document public API with Doxygen comments (
///or/** */); the API Reference is generated frominclude/tanh/on every push tomain.Design notes and guides live under
docs/sphinx/(reST or Markdown, both render); the README stays a short entry point that links here. The changelog page and the CMake options table are included fromCHANGELOG.mdandREADME.md, so keep those headings.Build locally with
just docsand openbuild/docs/docs/sphinx/html/index.html.
Changelog#
CHANGELOG.md follows Keep a Changelog. Add an entry under Unreleased
with every user-visible change, in the same style as the existing entries:
what changed, why, and what a consumer has to do about it.