src/hosts the core engine, text objects, and display backends; platform shims live undersrc/data/os/.tests/contains Catch2 suites (test-*.cc) plus fixtures; example assets reside indata/,extras/, andweb/.cmake/holds build helpers;3rdparty/pins vendored libraries;lua/exposes scripting hooks reused in configuration samples.- Build outputs stay in
build/; clean it between toolchain switches to avoid stale configuration issues.
- Configure:
cmake -S . -B build -G Ninja -DMAINTAINER_MODE=ONsets up a debug-friendly out-of-tree build aligned with CI. - Compile:
cmake --build buildorninja -C buildbuilds all binaries and modules. - Test:
ctest --test-dir build --output-on-failureruns the suite; narrow focus with./build/tests/test-conky "<test-or-tag>"(for example"[linux]") or./build/tests/test-conky --section "<section>". - Format:
cmake --build build --target clang-formatorninja -C build clang-formatrewrites sources; pair withcmake --build build --target check-clang-formatin CI. If the target is missing, reconfigure with-DCHECK_CODE_QUALITY=ON. - Coverage:
cmake -S . -B build -G Ninja -DMAINTAINER_MODE=ON -DCODE_COVERAGE=ONthencmake --build build --target test-conky-coverage-html; HTML results are generated in the build tree undertest-conky-coverage-html/(for examplebuild/tests/test-conky-coverage-html/index.html).
- Adopt Google C++ style: 2-space indent, 80-column target, left-aligned pointers (
char* ptr), and braced initialization. - Keep include blocks ordered: system, third-party, project. Run clang-format before committing, and avoid manual tabs.
- Mirror existing naming patterns such as
display_output_x11,text_object_xyz, and the callback pattern fromupdate-cb.hh(callback<Result, Keys...>plusregister_cb<YourCallback>) for new components.
- Add tests beside peers in
tests/, naming filestest-feature.ccand Catch2 sections with snake_case tags. - Wrap OS- or backend-specific assertions in the same
#ifdefguards used by the implementation. - Regenerate coverage after behavioral changes to confirm critical modules remain exercised.
- Prefer Conventional Commits (e.g.,
fix: correct .dockerignoreorbuild(deps): bump libfoo), keeping imperative, present-tense subjects. - Reference related issues or PRs with
(#1234), and keep each commit focused on one logical change. - PRs should outline intent, note validation commands, and attach screenshots when user-visible output changes.
- Confirm
ctest, formatting, and key runtime checks succeed before requesting review; reviewers expect merge-ready branches.
- Register text objects via the
OBJ,OBJ_ARG,OBJ_IF, andOBJ_IF_ARGmacros insrc/core.cc(construct_text_object) and reuse existing caching/update helpers instead of ad-hoc loops. - Backends derive from
display_output_base; ensure new drawing code degrades gracefully for ncurses and HTTP outputs. - Long-running stats should use the shared
update_cb+conky::callback_handlepattern to keep the UI responsive.