| Files | Last commit | Last update |
|---|---|---|
refactor(naming): use the .cpp suffix for C++ source files What: rename every C++ source file in the repository from .cc to .cpp (824 files, with git history kept as renames) and update the build lists, scripts, tests, configs, docs and source comments that name them. The project generators (ibmw-gen and ibmw_cli) now write .cpp files for new projects; when a project being regenerated already holds .cc sources from an earlier run, the generators keep .cc for it so the user's files and CMake lists stay consistent. A small helper picks the suffix from the output directory, and new tests cover both the new and the legacy case. Generated CMake lists from ibmw_cli accept both suffixes. The in-tree generated samples and the template project are regenerated with the new names. Why: the code check requires C++ source files to use the .cpp suffix. Verification: full build with 0 errors; ctest 75/75 passed; ibmw-gen tests 341 passed with only the known environment-dependent failure; mw_perf_collect tests 968 passed, 2 skipped; core metrics tests 215 passed; shell tests show only the three known environment failures; clang-format, generated-code format, license header, docs governance and release hygiene checks pass. Signed-off-by: fanglinxu <fanglinxu@huawei.com> | 5 days ago | |
refactor(style): keep stream operators at the end of wrapped lines What: - Split long stream output chains into one statement per line, so no wrapped line starts with a "<<" operator. - In tests, move long conditions or lookups into named locals and build long failure messages as a string first, so each assertion fits on one line. - Applied the same change repo-wide (about 180 statements in 79 files): JSON and YAML builders, CLI output, diagnostics and tests. Why: - The code checker requires that a wrapped expression keeps its operator at the end of the line, not at the start of the next line. clang-format always breaks before "<<", so the only way to satisfy both tools is to keep each statement short enough to fit on one line. - The produced text is unchanged: every split statement writes the same pieces in the same order. Verification: - build-ci full rebuild: no errors; ctest 75/75 passed. - mw_perf_collect tests: 969 passed, 2 skipped; core metrics tests: 215 passed. - clang-format dry run, generated-code format check, function size check and license check: all clean; no code line starts with a binary operator. Signed-off-by: fanglinxu <fanglinxu@huawei.com> | 5 days ago | |
refactor(naming): use the .cpp suffix for C++ source files What: rename every C++ source file in the repository from .cc to .cpp (824 files, with git history kept as renames) and update the build lists, scripts, tests, configs, docs and source comments that name them. The project generators (ibmw-gen and ibmw_cli) now write .cpp files for new projects; when a project being regenerated already holds .cc sources from an earlier run, the generators keep .cc for it so the user's files and CMake lists stay consistent. A small helper picks the suffix from the output directory, and new tests cover both the new and the legacy case. Generated CMake lists from ibmw_cli accept both suffixes. The in-tree generated samples and the template project are regenerated with the new names. Why: the code check requires C++ source files to use the .cpp suffix. Verification: full build with 0 errors; ctest 75/75 passed; ibmw-gen tests 341 passed with only the known environment-dependent failure; mw_perf_collect tests 968 passed, 2 skipped; core metrics tests 215 passed; shell tests show only the three known environment failures; clang-format, generated-code format, license header, docs governance and release hygiene checks pass. Signed-off-by: fanglinxu <fanglinxu@huawei.com> | 5 days ago | |
refactor(format): switch C and C++ sources to the OpenHarmony code style What: - Replace .clang-format with the OpenHarmony style required by the daily code check: 4-space indent, 120 columns, function left brace on its own line, braces on every if/for/while body, case labels indented. - Run clang-format 18 over all hand-written C and C++ files; the files generated by ibmw_gen (the kept *_gen samples and the template project) are left for the generator change that follows, except the headers the generator copies verbatim from the reformatted sources. - plain_dds_pubsub_type.h: the Fast DDS version #if now only switches the function signature, so both branches share one body brace; clang-format could not indent the old form. - Tests that search source text for a fixed indentation now use the new indentation or ignore it. Why: About 32 000 of the reported findings are layout rules (indentation, brace position, line width) that clang-format handles mechanically. This commit only changes whitespace, adds braces, splits long string literals and sorts using-declarations; a check of every file confirmed no other tokens changed and every #if branch keeps its brace balance. Verification: - Full build with -Werror: no errors; ctest: 75 of 75 passed - pytest src/tools/ibmw_gen/tests: 332 passed, 1 known failure (needs IBMW_BUILD_DIR) - scripts/tests: same results as before the change - scripts/check_clang_format.sh and its tests pass Signed-off-by: fanglinxu <fanglinxu@huawei.com> | 5 days ago | |
refactor(cxx): list lambda captures explicitly What: - Every lambda that used a default capture ([&], or [&, x]) now names what it captures, across src, selfdev, tools, samples and the ibmw-template project. A former [&] lists each variable by reference (&name) plus this where members are used; explicit captures that were already there are kept unchanged, so what is captured and how is the same as before. - The capture lists were derived from the compiler: the default capture was removed and every "not captured" error added that name, until the translation unit compiled again. Lambdas the build does not compile (other feature flags, OHOS-only and Fast DDS 3 code, the IBMW_DRIVER_ENTRY macro) were done by hand. - The copied Fibonacci action client in the generated sample follows its source. Why: the code check forbids default lambda captures; naming the captures shows which locals a lambda (often running on another thread) keeps references to. Verification: build-ci full build without errors; ctest 75/75; files outside the build compiled with a synthetic command (with and without the core metrics, comm trace and reporter flags) without new errors; clang -Wunused-lambda-capture reports no unused capture; scripts/regen_in_tree.sh reproduces the generated samples; clang-format clean. Signed-off-by: fanglinxu <fanglinxu@huawei.com> | 5 days ago | |
refactor(style): drop blank lines at block edges and before result checks What: - Removed the blank line between a statement that stores a result and the "if" that checks it (232 places, comments in between are kept). - Removed blank lines right after an opening brace and right before a closing brace of a code block, including extern "C" blocks (56 places). Namespace blocks keep their blank lines. - Fixed the ibmw_gen templates that produced these blank lines (type support package entry point, publisher/subscriber registration checks, RPC client status checks) and regenerated the in-tree samples. Why: - The code checker wants a result check to follow the call directly and no empty lines at the edges of a block. The generator change keeps newly generated code in the same shape. Verification: - build-ci full rebuild: no errors; ctest 75/75 passed. - ibmw_gen tests: 346 passed, only the known failure that needs a build directory; scripts/regen_in_tree.sh 18/18 passed. - clang-format dry run, generated-code format check, function size check and license check: all clean; the blank-line scan finds no remaining place in tracked or generated code. Signed-off-by: fanglinxu <fanglinxu@huawei.com> | 5 days ago | |
refactor(naming): use camelBack for parameters and local variables What: - Rename function parameters, local variables, local constants, static locals, structured bindings, lambda parameters, lambda init-captures and loop variables from snake_case (and UPPER_CASE local constants) to camelBack in the hand-written C/C++ sources, including function pointer parameter names in the C API structs. - Cover code clang-tidy cannot see: inactive #if branches (newer Fast DDS, OHOS, executor back-ends, test hook builds), files not in the CI build (ROS 2 samples, OHOS-only sources, extension tests, bench and selfdev tools) and locals declared inside function-like macros such as IBMW_PKG_MAIN and IBMW_USE_DRIVER(S). - Where a new name would clash with a name already in scope, pick a distinct name: the sample hello_msg.h constructor uses msgId/msg/ts, the shm transport driver's structured bindings are re-captured by name for the older OHOS clang, and one generic DDS type branch reuses the name the other branch already declares. - Update comments that name the parameters (/*name=*/ argument comments, @param, \p and inline prose). - Re-run clang-format on every changed file. - Members, types, enum values, globals, namespace constants, functions, macros, macro parameters and third-party code are unchanged. Why: the daily code check requires camelBack names for parameters and local variables. Verification: clang-tidy readability-identifier-naming for parameters and locals reports 0 findings in repo files; g++ -Wshadow over all build-ci sources shows no new warnings (two fewer); syntax checks of the core metrics/comm trace/test hook and fault/reporter build variants show no new errors; full build-ci build has no errors; ctest 75/75; mw_perf_collect pytest 968 passed, 2 skipped; core metrics pytest 215 passed; clang-format --dry-run -Werror clean on all C/C++ files; license header check 0 changes. Signed-off-by: fanglinxu <fanglinxu@huawei.com> | 5 days ago | |
refactor(format): switch C and C++ sources to the OpenHarmony code style What: - Replace .clang-format with the OpenHarmony style required by the daily code check: 4-space indent, 120 columns, function left brace on its own line, braces on every if/for/while body, case labels indented. - Run clang-format 18 over all hand-written C and C++ files; the files generated by ibmw_gen (the kept *_gen samples and the template project) are left for the generator change that follows, except the headers the generator copies verbatim from the reformatted sources. - plain_dds_pubsub_type.h: the Fast DDS version #if now only switches the function signature, so both branches share one body brace; clang-format could not indent the old form. - Tests that search source text for a fixed indentation now use the new indentation or ignore it. Why: About 32 000 of the reported findings are layout rules (indentation, brace position, line width) that clang-format handles mechanically. This commit only changes whitespace, adds braces, splits long string literals and sorts using-declarations; a check of every file confirmed no other tokens changed and every #if branch keeps its brace balance. Verification: - Full build with -Werror: no errors; ctest: 75 of 75 passed - pytest src/tools/ibmw_gen/tests: 332 passed, 1 known failure (needs IBMW_BUILD_DIR) - scripts/tests: same results as before the change - scripts/check_clang_format.sh and its tests pass Signed-off-by: fanglinxu <fanglinxu@huawei.com> | 5 days ago | |
refactor(core): rename internal members, constants and functions What: - Data members of internal core structs and classes now use camelBack, keeping the trailing underscore of private members (for example positional_args -> positionalArgs, bytes_per_second -> bytesPerSecond). - Internal constants and enum values now use UPPER_CASE without the old "k" prefix. - Communication trace helpers now use CamelCase (Mode, Drain, Pending, Dropped, CurrentThreadDropped, RegistryDropped, RegisteredThreads, SnapshotThreadDrops, ResetForTest). - Topic tap stream results are named RECEIVE_OK, END_OF_STREAM and RECEIVE_ERROR, because plain OK, EOF and ERROR clash with common macros. - Tests in base, api and the diagnostics tool follow the new names. - Names kept: those in installed headers and those that must match an external library (yaml-cpp convert specializations). Why: - The code checker asks for one naming style; these names are internal, so changing them does not affect users of the installed API. Verification: - build-ci and a second build with the optional transports and features turned on: no errors; ctest 75/75 passed. - Files that are not built in these configurations were compared with the previous commit by a syntax check: no new errors. - clang-format dry run over all tracked C/C++ files: clean; generated code format check, function size check and license check: clean. - A search for every old name finds only uses that belong to other scopes (public API names, message fields, other classes). Signed-off-by: fanglinxu <fanglinxu@huawei.com> | 5 days ago | |
refactor(src): put loop checks right after the call they depend on What: - dynamiclatch.h, the DDS RPC driver (server and client listeners) and the wide publisher sample no longer have a blank line between a call that produces a value and the while loop that checks it. Why: The code checker asks for a check of a call result to follow the call directly. Only blank lines are removed. Verification: build-ci incremental build without errors, ctest 74/75: the bounded queue timing test BoundedBlockingQueueTest.StarvedSpinnerDoesNotStallSteadyPushes failed, and also failed in 2 of 3 runs alone. Its sources and test binary are not changed by this work; the cause was not investigated. Build and ctest were run on the final tree, not on each commit. Other checks: clang-format clean. The wide publisher sample is not part of build-ci and was not compiled; the change there is one removed blank line. Signed-off-by: fanglinxu <fanglinxu@huawei.com> | 5 days ago | |
refactor(naming): use the .cpp suffix for C++ source files What: rename every C++ source file in the repository from .cc to .cpp (824 files, with git history kept as renames) and update the build lists, scripts, tests, configs, docs and source comments that name them. The project generators (ibmw-gen and ibmw_cli) now write .cpp files for new projects; when a project being regenerated already holds .cc sources from an earlier run, the generators keep .cc for it so the user's files and CMake lists stay consistent. A small helper picks the suffix from the output directory, and new tests cover both the new and the legacy case. Generated CMake lists from ibmw_cli accept both suffixes. The in-tree generated samples and the template project are regenerated with the new names. Why: the code check requires C++ source files to use the .cpp suffix. Verification: full build with 0 errors; ctest 75/75 passed; ibmw-gen tests 341 passed with only the known environment-dependent failure; mw_perf_collect tests 968 passed, 2 skipped; core metrics tests 215 passed; shell tests show only the three known environment failures; clang-format, generated-code format, license header, docs governance and release hygiene checks pass. Signed-off-by: fanglinxu <fanglinxu@huawei.com> | 5 days ago | |
refactor(format): switch C and C++ sources to the OpenHarmony code style What: - Replace .clang-format with the OpenHarmony style required by the daily code check: 4-space indent, 120 columns, function left brace on its own line, braces on every if/for/while body, case labels indented. - Run clang-format 18 over all hand-written C and C++ files; the files generated by ibmw_gen (the kept *_gen samples and the template project) are left for the generator change that follows, except the headers the generator copies verbatim from the reformatted sources. - plain_dds_pubsub_type.h: the Fast DDS version #if now only switches the function signature, so both branches share one body brace; clang-format could not indent the old form. - Tests that search source text for a fixed indentation now use the new indentation or ignore it. Why: About 32 000 of the reported findings are layout rules (indentation, brace position, line width) that clang-format handles mechanically. This commit only changes whitespace, adds braces, splits long string literals and sorts using-declarations; a check of every file confirmed no other tokens changed and every #if branch keeps its brace balance. Verification: - Full build with -Werror: no errors; ctest: 75 of 75 passed - pytest src/tools/ibmw_gen/tests: 332 passed, 1 known failure (needs IBMW_BUILD_DIR) - scripts/tests: same results as before the change - scripts/check_clang_format.sh and its tests pass Signed-off-by: fanglinxu <fanglinxu@huawei.com> | 5 days ago | |
refactor(naming): use camelBack for parameters and local variables What: - Rename function parameters, local variables, local constants, static locals, structured bindings, lambda parameters, lambda init-captures and loop variables from snake_case (and UPPER_CASE local constants) to camelBack in the hand-written C/C++ sources, including function pointer parameter names in the C API structs. - Cover code clang-tidy cannot see: inactive #if branches (newer Fast DDS, OHOS, executor back-ends, test hook builds), files not in the CI build (ROS 2 samples, OHOS-only sources, extension tests, bench and selfdev tools) and locals declared inside function-like macros such as IBMW_PKG_MAIN and IBMW_USE_DRIVER(S). - Where a new name would clash with a name already in scope, pick a distinct name: the sample hello_msg.h constructor uses msgId/msg/ts, the shm transport driver's structured bindings are re-captured by name for the older OHOS clang, and one generic DDS type branch reuses the name the other branch already declares. - Update comments that name the parameters (/*name=*/ argument comments, @param, \p and inline prose). - Re-run clang-format on every changed file. - Members, types, enum values, globals, namespace constants, functions, macros, macro parameters and third-party code are unchanged. Why: the daily code check requires camelBack names for parameters and local variables. Verification: clang-tidy readability-identifier-naming for parameters and locals reports 0 findings in repo files; g++ -Wshadow over all build-ci sources shows no new warnings (two fewer); syntax checks of the core metrics/comm trace/test hook and fault/reporter build variants show no new errors; full build-ci build has no errors; ctest 75/75; mw_perf_collect pytest 968 passed, 2 skipped; core metrics pytest 215 passed; clang-format --dry-run -Werror clean on all C/C++ files; license header check 0 changes. Signed-off-by: fanglinxu <fanglinxu@huawei.com> | 5 days ago | |
refactor(format): switch C and C++ sources to the OpenHarmony code style What: - Replace .clang-format with the OpenHarmony style required by the daily code check: 4-space indent, 120 columns, function left brace on its own line, braces on every if/for/while body, case labels indented. - Run clang-format 18 over all hand-written C and C++ files; the files generated by ibmw_gen (the kept *_gen samples and the template project) are left for the generator change that follows, except the headers the generator copies verbatim from the reformatted sources. - plain_dds_pubsub_type.h: the Fast DDS version #if now only switches the function signature, so both branches share one body brace; clang-format could not indent the old form. - Tests that search source text for a fixed indentation now use the new indentation or ignore it. Why: About 32 000 of the reported findings are layout rules (indentation, brace position, line width) that clang-format handles mechanically. This commit only changes whitespace, adds braces, splits long string literals and sorts using-declarations; a check of every file confirmed no other tokens changed and every #if branch keeps its brace balance. Verification: - Full build with -Werror: no errors; ctest: 75 of 75 passed - pytest src/tools/ibmw_gen/tests: 332 passed, 1 known failure (needs IBMW_BUILD_DIR) - scripts/tests: same results as before the change - scripts/check_clang_format.sh and its tests pass Signed-off-by: fanglinxu <fanglinxu@huawei.com> | 5 days ago | |
chore(license): put the Apache-2.0 header on every source file, add OAT.xml What: Every source, script, build and configuration file now starts with the full Apache-2.0 license header and the copyright line "Copyright (c) 2025-2026 IB-Robot Group & openEuler Embedded SIG & openharmony-robot sig_RoboFrame." (no comma after the years). The "All rights reserved." line and the Mulan PSL v2 line of the loaned message demo are removed; the repository LICENSE is Apache-2.0. A shebang, coding line or XML declaration stays first. Jinja2 templates carry the header in a template comment, so it is not copied into rendered files. The new OAT.xml registers the copyright holders and the license, and filters files that cannot carry a header (JSON, golden generator output, patches, the recorded rosbag test data, documentation), each with its reason. Why: The OpenHarmony CI open-source audit reported 3527 fatal issues: files without a license header, copyright lines it does not accept, and binary files not registered. Only file headers and OAT.xml change; no code changes. Verification: Release hygiene and docs governance pass. The header script is idempotent (a second run changes nothing) and its diff only removes old header lines and the comment separators after them. ibmw_gen tests and scripts/tests give the same results as before the change; the installed-consumer test builds and installs the whole tree. Signed-off-by: fanglinxu <fanglinxu@huawei.com> | 5 days ago | |
refactor(style): drop blank lines at block edges and before result checks What: - Removed the blank line between a statement that stores a result and the "if" that checks it (232 places, comments in between are kept). - Removed blank lines right after an opening brace and right before a closing brace of a code block, including extern "C" blocks (56 places). Namespace blocks keep their blank lines. - Fixed the ibmw_gen templates that produced these blank lines (type support package entry point, publisher/subscriber registration checks, RPC client status checks) and regenerated the in-tree samples. Why: - The code checker wants a result check to follow the call directly and no empty lines at the edges of a block. The generator change keeps newly generated code in the same shape. Verification: - build-ci full rebuild: no errors; ctest 75/75 passed. - ibmw_gen tests: 346 passed, only the known failure that needs a build directory; scripts/regen_in_tree.sh 18/18 passed. - clang-format dry run, generated-code format check, function size check and license check: all clean; the blank-line scan finds no remaining place in tracked or generated code. Signed-off-by: fanglinxu <fanglinxu@huawei.com> | 5 days ago | |
refactor(format): switch C and C++ sources to the OpenHarmony code style What: - Replace .clang-format with the OpenHarmony style required by the daily code check: 4-space indent, 120 columns, function left brace on its own line, braces on every if/for/while body, case labels indented. - Run clang-format 18 over all hand-written C and C++ files; the files generated by ibmw_gen (the kept *_gen samples and the template project) are left for the generator change that follows, except the headers the generator copies verbatim from the reformatted sources. - plain_dds_pubsub_type.h: the Fast DDS version #if now only switches the function signature, so both branches share one body brace; clang-format could not indent the old form. - Tests that search source text for a fixed indentation now use the new indentation or ignore it. Why: About 32 000 of the reported findings are layout rules (indentation, brace position, line width) that clang-format handles mechanically. This commit only changes whitespace, adds braces, splits long string literals and sorts using-declarations; a check of every file confirmed no other tokens changed and every #if branch keeps its brace balance. Verification: - Full build with -Werror: no errors; ctest: 75 of 75 passed - pytest src/tools/ibmw_gen/tests: 332 passed, 1 known failure (needs IBMW_BUILD_DIR) - scripts/tests: same results as before the change - scripts/check_clang_format.sh and its tests pass Signed-off-by: fanglinxu <fanglinxu@huawei.com> | 5 days ago | |
refactor(naming): use the .cpp suffix for C++ source files What: rename every C++ source file in the repository from .cc to .cpp (824 files, with git history kept as renames) and update the build lists, scripts, tests, configs, docs and source comments that name them. The project generators (ibmw-gen and ibmw_cli) now write .cpp files for new projects; when a project being regenerated already holds .cc sources from an earlier run, the generators keep .cc for it so the user's files and CMake lists stay consistent. A small helper picks the suffix from the output directory, and new tests cover both the new and the legacy case. Generated CMake lists from ibmw_cli accept both suffixes. The in-tree generated samples and the template project are regenerated with the new names. Why: the code check requires C++ source files to use the .cpp suffix. Verification: full build with 0 errors; ctest 75/75 passed; ibmw-gen tests 341 passed with only the known environment-dependent failure; mw_perf_collect tests 968 passed, 2 skipped; core metrics tests 215 passed; shell tests show only the three known environment failures; clang-format, generated-code format, license header, docs governance and release hygiene checks pass. Signed-off-by: fanglinxu <fanglinxu@huawei.com> | 5 days ago | |
refactor(cxx): tidy comments, placeholders and empty catch blocks What: - Comment lines that hold only "//" are removed from C/C++ sources and from the ibmw_gen templates; paragraphs in a comment block now follow each other directly. The C API headers drop the empty "Parameter definition:" heading above the Input/Output lists. - Argument labels written inside a call (/*name=*/value) move to a trailing comment of the same line; unnamed parameters lose their inline /*name*/ comment. - Every empty catch block states why the exception is ignored (destructor or noexcept path, C ABI boundary, best-effort cleanup, expected failure in a test). - ibmw_gen writes plain placeholder comments ("Fill in the msg fields here.", "Write the handler logic here, ...") instead of TODO notes. The user_code merge still recognises the older TODO wording of direct_* templates, so sources produced by older versions keep merging; a test covers this. The gRPC driver states its http-only limit without TODO. - In-tree generated samples and the ibmw-template project are regenerated. Why: the code check asks for no empty formatted header comments, for comments above or to the right of code, for a reason in every empty catch block and for no TODO/FIXME notes in delivered code. Verification: build-ci full build without errors; ctest passes (one DDS service test flaked under load and passes on rerun); ibmw_gen pytest 342 passed (only the known installed-build test fails); scripts/regen_in_tree.sh 18/18; clang-format clean. Signed-off-by: fanglinxu <fanglinxu@huawei.com> | 5 days ago | |
refactor(format): switch C and C++ sources to the OpenHarmony code style What: - Replace .clang-format with the OpenHarmony style required by the daily code check: 4-space indent, 120 columns, function left brace on its own line, braces on every if/for/while body, case labels indented. - Run clang-format 18 over all hand-written C and C++ files; the files generated by ibmw_gen (the kept *_gen samples and the template project) are left for the generator change that follows, except the headers the generator copies verbatim from the reformatted sources. - plain_dds_pubsub_type.h: the Fast DDS version #if now only switches the function signature, so both branches share one body brace; clang-format could not indent the old form. - Tests that search source text for a fixed indentation now use the new indentation or ignore it. Why: About 32 000 of the reported findings are layout rules (indentation, brace position, line width) that clang-format handles mechanically. This commit only changes whitespace, adds braces, splits long string literals and sorts using-declarations; a check of every file confirmed no other tokens changed and every #if branch keeps its brace balance. Verification: - Full build with -Werror: no errors; ctest: 75 of 75 passed - pytest src/tools/ibmw_gen/tests: 332 passed, 1 known failure (needs IBMW_BUILD_DIR) - scripts/tests: same results as before the change - scripts/check_clang_format.sh and its tests pass Signed-off-by: fanglinxu <fanglinxu@huawei.com> | 5 days ago | |
refactor(naming): use camelBack for parameters and local variables What: - Rename function parameters, local variables, local constants, static locals, structured bindings, lambda parameters, lambda init-captures and loop variables from snake_case (and UPPER_CASE local constants) to camelBack in the hand-written C/C++ sources, including function pointer parameter names in the C API structs. - Cover code clang-tidy cannot see: inactive #if branches (newer Fast DDS, OHOS, executor back-ends, test hook builds), files not in the CI build (ROS 2 samples, OHOS-only sources, extension tests, bench and selfdev tools) and locals declared inside function-like macros such as IBMW_PKG_MAIN and IBMW_USE_DRIVER(S). - Where a new name would clash with a name already in scope, pick a distinct name: the sample hello_msg.h constructor uses msgId/msg/ts, the shm transport driver's structured bindings are re-captured by name for the older OHOS clang, and one generic DDS type branch reuses the name the other branch already declares. - Update comments that name the parameters (/*name=*/ argument comments, @param, \p and inline prose). - Re-run clang-format on every changed file. - Members, types, enum values, globals, namespace constants, functions, macros, macro parameters and third-party code are unchanged. Why: the daily code check requires camelBack names for parameters and local variables. Verification: clang-tidy readability-identifier-naming for parameters and locals reports 0 findings in repo files; g++ -Wshadow over all build-ci sources shows no new warnings (two fewer); syntax checks of the core metrics/comm trace/test hook and fault/reporter build variants show no new errors; full build-ci build has no errors; ctest 75/75; mw_perf_collect pytest 968 passed, 2 skipped; core metrics pytest 215 passed; clang-format --dry-run -Werror clean on all C/C++ files; license header check 0 changes. Signed-off-by: fanglinxu <fanglinxu@huawei.com> | 5 days ago | |
refactor(base): split the string helper header and its long functions What: Move the key/value helpers (SplitToMap, JoinMap, GetValueFromStrKV, CheckIfInList and friends) into base/string_kv_util.h and the table renderers (DrawTable, FormatTree) into base/string_table_util.h. string_util.h includes both, so every existing include keeps working. DrawTable, FormatTree, SplitToMap and ReplaceString are split into small helpers with the same output. Why: string_util.h exceeded the header size limit and these functions exceeded the function length, nesting and complexity limits of the CI code check. Verification: full build with -Werror, ctest 75/75, function size checker clean for src/base. Signed-off-by: fanglinxu <fanglinxu@huawei.com> | 5 days ago | |
refactor(style): keep stream operators at the end of wrapped lines What: - Split long stream output chains into one statement per line, so no wrapped line starts with a "<<" operator. - In tests, move long conditions or lookups into named locals and build long failure messages as a string first, so each assertion fits on one line. - Applied the same change repo-wide (about 180 statements in 79 files): JSON and YAML builders, CLI output, diagnostics and tests. Why: - The code checker requires that a wrapped expression keeps its operator at the end of the line, not at the start of the next line. clang-format always breaks before "<<", so the only way to satisfy both tools is to keep each statement short enough to fit on one line. - The produced text is unchanged: every split statement writes the same pieces in the same order. Verification: - build-ci full rebuild: no errors; ctest 75/75 passed. - mw_perf_collect tests: 969 passed, 2 skipped; core metrics tests: 215 passed. - clang-format dry run, generated-code format check, function size check and license check: all clean; no code line starts with a binary operator. Signed-off-by: fanglinxu <fanglinxu@huawei.com> | 5 days ago | |
refactor(style): put a space between a qualifier and a following pointer mark What: - .clang-format: added "SpaceAroundPointerQualifiers: After", so a "*" or "&" that follows "const" is written with a space, for example "const char* const * argv" and "() const &". - Reformatted the 33 files this touches (CLI argument lists, crash handler frame arrays, DDS loan buffer, schema entry list, ref-qualified members). - Wrote the two "T const&" parameters and two "auto const&" loop variables as "const T&" / "const auto&" instead. Why: - The code checker requires a space between "const" and a pointer mark that follows it, and accepts "const * name". Doing it through clang-format keeps the rule enforced for new code; no other layout changes. Verification: - clang-format dry run over all tracked C/C++ files: clean; generated-code format check: clean. - build-ci full rebuild: no errors, no warnings; ctest 75/75 passed. Signed-off-by: fanglinxu <fanglinxu@huawei.com> | 5 days ago | |
refactor(naming): use the .cpp suffix for C++ source files What: rename every C++ source file in the repository from .cc to .cpp (824 files, with git history kept as renames) and update the build lists, scripts, tests, configs, docs and source comments that name them. The project generators (ibmw-gen and ibmw_cli) now write .cpp files for new projects; when a project being regenerated already holds .cc sources from an earlier run, the generators keep .cc for it so the user's files and CMake lists stay consistent. A small helper picks the suffix from the output directory, and new tests cover both the new and the legacy case. Generated CMake lists from ibmw_cli accept both suffixes. The in-tree generated samples and the template project are regenerated with the new names. Why: the code check requires C++ source files to use the .cpp suffix. Verification: full build with 0 errors; ctest 75/75 passed; ibmw-gen tests 341 passed with only the known environment-dependent failure; mw_perf_collect tests 968 passed, 2 skipped; core metrics tests 215 passed; shell tests show only the three known environment failures; clang-format, generated-code format, license header, docs governance and release hygiene checks pass. Signed-off-by: fanglinxu <fanglinxu@huawei.com> | 5 days ago | |
refactor(format): switch C and C++ sources to the OpenHarmony code style What: - Replace .clang-format with the OpenHarmony style required by the daily code check: 4-space indent, 120 columns, function left brace on its own line, braces on every if/for/while body, case labels indented. - Run clang-format 18 over all hand-written C and C++ files; the files generated by ibmw_gen (the kept *_gen samples and the template project) are left for the generator change that follows, except the headers the generator copies verbatim from the reformatted sources. - plain_dds_pubsub_type.h: the Fast DDS version #if now only switches the function signature, so both branches share one body brace; clang-format could not indent the old form. - Tests that search source text for a fixed indentation now use the new indentation or ignore it. Why: About 32 000 of the reported findings are layout rules (indentation, brace position, line width) that clang-format handles mechanically. This commit only changes whitespace, adds braces, splits long string literals and sorts using-declarations; a check of every file confirmed no other tokens changed and every #if branch keeps its brace balance. Verification: - Full build with -Werror: no errors; ctest: 75 of 75 passed - pytest src/tools/ibmw_gen/tests: 332 passed, 1 known failure (needs IBMW_BUILD_DIR) - scripts/tests: same results as before the change - scripts/check_clang_format.sh and its tests pass Signed-off-by: fanglinxu <fanglinxu@huawei.com> | 5 days ago | |
refactor(naming): use the .cpp suffix for C++ source files What: rename every C++ source file in the repository from .cc to .cpp (824 files, with git history kept as renames) and update the build lists, scripts, tests, configs, docs and source comments that name them. The project generators (ibmw-gen and ibmw_cli) now write .cpp files for new projects; when a project being regenerated already holds .cc sources from an earlier run, the generators keep .cc for it so the user's files and CMake lists stay consistent. A small helper picks the suffix from the output directory, and new tests cover both the new and the legacy case. Generated CMake lists from ibmw_cli accept both suffixes. The in-tree generated samples and the template project are regenerated with the new names. Why: the code check requires C++ source files to use the .cpp suffix. Verification: full build with 0 errors; ctest 75/75 passed; ibmw-gen tests 341 passed with only the known environment-dependent failure; mw_perf_collect tests 968 passed, 2 skipped; core metrics tests 215 passed; shell tests show only the three known environment failures; clang-format, generated-code format, license header, docs governance and release hygiene checks pass. Signed-off-by: fanglinxu <fanglinxu@huawei.com> | 5 days ago | |
refactor(base): replace C memory and formatting calls in shared utilities What: The byte buffer, string replace, time formatting and benchmark summary helpers in src/base, and the logger formatter, rotating file logger and crash signal setup, no longer call memcpy, memmove, memset, snprintf or sprintf. Copies use std::copy_n (std::copy_backward for the right shift in ReplaceString, where source and destination overlap); time strings are built by a small zero-padding writer with the same buffer sizes and output; a GetCompactTimeStr helper gives the "YYYYMMDD_hhmmss" form used by file names; the benchmark summary uses a string stream with two decimals; sigaction structs are value-initialised. Why: The code check reports these C library functions as unsafe. The standard C++ algorithms keep explicit lengths, and on byte pointers they compile to the same memmove, so the copy count and speed of the buffer paths do not change. Verification: build-ci builds with -Werror; ctest 75/75 (including the buffer, string and time utility tests); clang-format clean. Signed-off-by: fanglinxu <fanglinxu@huawei.com> | 5 days ago | |
refactor(cxx): make argument loops, declarations and expressions explicit What: - Command-line parsers (ibmw CLI, bag command, capture agent, shm and transport benchmarks, action samples) and the retry loops in the shm tests no longer change a for-loop counter inside the body. They are while loops that consume one argument at a time; option values are read with the same cursor. The bag record parser hands its own copy of the cursor to the discovery option parser. - The URL decoders walk the string with a while loop. - Syscall results that are filled by an EINTR retry loop start with -1; variables that were declared and assigned on the next line are initialised directly. - Arithmetic inside stream output is parenthesised. - Header constants use inline constexpr instead of static (also in the JSON RPC client template of ibmw_gen). - Sources that declared extern char** environ rely on <unistd.h>. - The thread-local buffer of the module allocator checks malloc: a failed allocation returns nullptr and the next call tries again instead of keeping a stale size with no buffer. - The roadmap page script writes 0.08 and destructures the first section. Why: the code check asks not to modify basic for-loop counters in the body, to declare variables where they are initialised, to make operator precedence explicit, to avoid static definitions in headers and extern declarations in sources, and to handle malloc results. Verification: build-ci full build without errors; ctest 75/75; mw_perf_collect pytest 968 passed, 2 skipped; ibmw_gen pytest 342 passed (only the known installed-build test fails); sources outside the build (benchmarks, action samples, capture agent) syntax-checked with the synthetic commands; clang-format clean. Signed-off-by: fanglinxu <fanglinxu@huawei.com> | 5 days ago | |
refactor(naming): use the .cpp suffix for C++ source files What: rename every C++ source file in the repository from .cc to .cpp (824 files, with git history kept as renames) and update the build lists, scripts, tests, configs, docs and source comments that name them. The project generators (ibmw-gen and ibmw_cli) now write .cpp files for new projects; when a project being regenerated already holds .cc sources from an earlier run, the generators keep .cc for it so the user's files and CMake lists stay consistent. A small helper picks the suffix from the output directory, and new tests cover both the new and the legacy case. Generated CMake lists from ibmw_cli accept both suffixes. The in-tree generated samples and the template project are regenerated with the new names. Why: the code check requires C++ source files to use the .cpp suffix. Verification: full build with 0 errors; ctest 75/75 passed; ibmw-gen tests 341 passed with only the known environment-dependent failure; mw_perf_collect tests 968 passed, 2 skipped; core metrics tests 215 passed; shell tests show only the three known environment failures; clang-format, generated-code format, license header, docs governance and release hygiene checks pass. Signed-off-by: fanglinxu <fanglinxu@huawei.com> | 5 days ago | |
refactor(style): drop blank lines at block edges and before result checks What: - Removed the blank line between a statement that stores a result and the "if" that checks it (232 places, comments in between are kept). - Removed blank lines right after an opening brace and right before a closing brace of a code block, including extern "C" blocks (56 places). Namespace blocks keep their blank lines. - Fixed the ibmw_gen templates that produced these blank lines (type support package entry point, publisher/subscriber registration checks, RPC client status checks) and regenerated the in-tree samples. Why: - The code checker wants a result check to follow the call directly and no empty lines at the edges of a block. The generator change keeps newly generated code in the same shape. Verification: - build-ci full rebuild: no errors; ctest 75/75 passed. - ibmw_gen tests: 346 passed, only the known failure that needs a build directory; scripts/regen_in_tree.sh 18/18 passed. - clang-format dry run, generated-code format check, function size check and license check: all clean; the blank-line scan finds no remaining place in tracked or generated code. Signed-off-by: fanglinxu <fanglinxu@huawei.com> | 5 days ago | |
refactor(naming): use camelBack for parameters and local variables What: - Rename function parameters, local variables, local constants, static locals, structured bindings, lambda parameters, lambda init-captures and loop variables from snake_case (and UPPER_CASE local constants) to camelBack in the hand-written C/C++ sources, including function pointer parameter names in the C API structs. - Cover code clang-tidy cannot see: inactive #if branches (newer Fast DDS, OHOS, executor back-ends, test hook builds), files not in the CI build (ROS 2 samples, OHOS-only sources, extension tests, bench and selfdev tools) and locals declared inside function-like macros such as IBMW_PKG_MAIN and IBMW_USE_DRIVER(S). - Where a new name would clash with a name already in scope, pick a distinct name: the sample hello_msg.h constructor uses msgId/msg/ts, the shm transport driver's structured bindings are re-captured by name for the older OHOS clang, and one generic DDS type branch reuses the name the other branch already declares. - Update comments that name the parameters (/*name=*/ argument comments, @param, \p and inline prose). - Re-run clang-format on every changed file. - Members, types, enum values, globals, namespace constants, functions, macros, macro parameters and third-party code are unchanged. Why: the daily code check requires camelBack names for parameters and local variables. Verification: clang-tidy readability-identifier-naming for parameters and locals reports 0 findings in repo files; g++ -Wshadow over all build-ci sources shows no new warnings (two fewer); syntax checks of the core metrics/comm trace/test hook and fault/reporter build variants show no new errors; full build-ci build has no errors; ctest 75/75; mw_perf_collect pytest 968 passed, 2 skipped; core metrics pytest 215 passed; clang-format --dry-run -Werror clean on all C/C++ files; license header check 0 changes. Signed-off-by: fanglinxu <fanglinxu@huawei.com> | 5 days ago |
| Files | Last commit | Last update |
|---|---|---|
| 5 days ago | ||
| 5 days ago | ||
| 5 days ago | ||
| 5 days ago | ||
| 5 days ago | ||
| 5 days ago | ||
| 5 days ago | ||
| 5 days ago | ||
| 5 days ago | ||
| 5 days ago | ||
| 5 days ago | ||
| 5 days ago | ||
| 5 days ago | ||
| 5 days ago | ||
| 5 days ago | ||
| 5 days ago | ||
| 5 days ago | ||
| 5 days ago | ||
| 5 days ago | ||
| 5 days ago | ||
| 5 days ago | ||
| 5 days ago | ||
| 5 days ago | ||
| 5 days ago | ||
| 5 days ago | ||
| 5 days ago | ||
| 5 days ago | ||
| 5 days ago | ||
| 5 days ago | ||
| 5 days ago | ||
| 5 days ago | ||
| 5 days ago |