Thank you for your interest! Please follow these guidelines.
# Build
make
# Run all tests
make test
# Build just the binary
make uci-shell
# Get help
make help- Language: C11 (
-std=c11) - Format: Google style, Allman braces, 4-space indent, 120 char line limit
.clang-formatfile present in repository root — configure your editor.editorconfigpresent for editor integration (Vim, VS Code, etc.)
- Compiler flags:
-Wall -Wextra -g -DHAVE_READLINE - Zero warnings: Every file must compile without warnings under
-Wall -Wextra
- Subject line: ≤ 72 chars, imperative mood (
add,fix,remove,refactor) - Scope prefix (optional but preferred):
ci:,docs:,src/,include/,test/,make:,style: - Body: Explain why the change is needed. Reference any related
uci_pdl.hconstant orCOMMAND_REFERENCE.mdentry when relevant.
Examples:
Add `analyze_packet --tlv` flag for raw TLV hex output
The existing analyzer only shows decoded field names. Adding --tlv
exposes the raw hex bytes between the message header and the
session handle, which is needed for vendor-specific payload debugging.
refs: include/uci_pdl.h UCI_PACKET_TLV_TYPE
See docs/ARCHITECTURE.md §2 ("Command Framework") for the full procedure.
The short form:
- Add a row to the appropriate
g_cmd_table[]insrc/uci_cmd_framework_*.c - Write the handler function in the appropriate
src/uci_cmd*.c - Register the argument template in the existing table entry
- No documentation write-up needed — the framework auto-generates help text
- Add a regression test in the appropriate
tests/test_*.c
All tests live under tests/:
- Each
.ctest file runs its own test runner and reportsRESULT: ALL TESTS PASSED. - Tests compile with
$(CC) $(CFLAGS) -o test_foo tests/test_foo.c $(LIBS). - New tests should go in an existing file if the scope matches, or a new
tests/test_<name>.cotherwise. - All new test binary names must be added to the
Makefile.PHONYlist and thetest:target.
Common patterns:
// Assertion
TEST_ASSERT(condition, "short message");
TEST_ASSERT_EQ(expected, actual, "description");
TEST_ASSERT_STR_EQ(expected, actual);
TEST_ASSERT_BUF_EQ(expected, actual, len);
// Test runner
#define RUNTEST(fn) printf(" %s ... %s\n", #fn, fn() ? "PASSED" : "FAILED"); ok &= fn()-
make helpstill shows all targets -
make clean && make -Werrorcompiles without warnings -
make testpasses (all suites) -
src/main.orebuilds if headers changed - New commands appear in
helpoutput automatically - Protocol constants come from
include/uci_pdl.h, not embedded literals -
.clang-format/.editorconfigrules followed (or rules updated if needed)
- Include: OS,
make --version,gcc --version, test failures - For protocol bugs: wire packet bytes (
analyze_packet <hex>) and expected vs. actual output