Skip to content

Code-review cleanups: sources, CMake, CI#11

Merged
mousebrains merged 2 commits into
masterfrom
chore/code-review-improvements
Jun 11, 2026
Merged

Code-review cleanups: sources, CMake, CI#11
mousebrains merged 2 commits into
masterfrom
chore/code-review-improvements

Conversation

@mousebrains

Copy link
Copy Markdown
Owner

Summary

Cleanups from a code review pass over the sources, build system, and CI. All changes are output-neutral: the integration tests diff converter output against the checked-in reference files and pass unchanged (31/31 locally on macOS, zero build warnings).

Source changes

  • Data.C: read the per-record state bits into uint8_t instead of int8_t, so extracting the 2-bit sensor codes no longer relies on implementation-defined right-shift of negative values (the & 0x03 mask made the old code produce identical results on all supported compilers, but the standard didn't guarantee it). Documented the meaning of all four state codes — the silent skip of codes 0 (not sampled) and 3 (unused) previously read like a bug.
  • Sensors: removed dead mLength/length() — never read anywhere. Also eliminates a tellg() - spos expression that underflowed to a huge size_t if the stream failed mid-parse.
  • SensorsMap.C: build the unknown-CRC exception message with string concatenation instead of a fixed 2 KB snprintf buffer; drop a wrong-direction int cast when inserting into the size_t-valued name map.
  • Logger.H: fall back to spdlog's default logger if init() fails twice, so the logging macros can never dereference a null logger.

Build / CI

  • src/CMakeLists.txt: stop double-linking spdlog and dbd_common into executables — the PUBLIC links on dbd_common/dbd_netcdf already provide them transitively. Silences the ld: ignoring duplicate libraries warnings on every macOS build. decompressTWR keeps its direct spdlog link since it deliberately avoids dbd_common.
  • build-test.yml: include test/decompressTWR in the shellcheck lint step — it was the only test script not being checked (verified it passes shellcheck).
  • .claude/settings.json: permission allowlist so Claude Code doesn't prompt for tree-local commands (build, test, lint, local git, project binaries). Drop this commit if you'd rather keep that config out of the repo.

Test plan

  • Clean rebuild from scratch (Release, AppleClang): zero warnings
  • ctest: 31/31 passing, including reference-file comparison integration tests for all five tools
  • shellcheck -s sh test/decompressTWR passes locally

🤖 Generated with Claude Code

mousebrains and others added 2 commits June 10, 2026 19:12
- Data.C: read the per-record state bits into uint8_t instead of int8_t
  so extracting the 2-bit sensor codes no longer relies on
  implementation-defined right-shift of negative values; document the
  meaning of all four state codes (0/3 are intentionally skipped)
- Sensors: remove dead mLength/length() (never read anywhere), which
  also drops a tellg() expression that underflowed on stream failure
- SensorsMap.C: build the unknown-CRC exception message with string
  concatenation instead of a fixed snprintf buffer; drop a
  wrong-direction int cast when inserting into the size_t-valued map
- Logger.H: fall back to spdlog's default logger if init fails twice,
  so logging callers can never dereference a null logger
- CMake: stop double-linking spdlog and dbd_common into executables
  (PUBLIC links on dbd_common/dbd_netcdf already provide them); this
  silences "ignoring duplicate libraries" ld warnings on macOS;
  decompressTWR keeps a direct spdlog link since it avoids dbd_common
- CI: include test/decompressTWR in the shellcheck lint step (it was
  the only test script not being checked)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Allow build/test/lint tooling, tree-local git operations, and running
the project-built binaries without permission prompts. Outward-facing
actions (git push, installs) still prompt.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.02%. Comparing base (6dfeb12) to head (fb5f55d).

Files with missing lines Patch % Lines
src/Logger.H 50.00% 1 Missing ⚠️
src/SensorsMap.C 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #11      +/-   ##
==========================================
- Coverage   63.04%   63.02%   -0.03%     
==========================================
  Files          34       34              
  Lines        3412     3410       -2     
  Branches      423      424       +1     
==========================================
- Hits         2151     2149       -2     
  Misses       1261     1261              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mousebrains mousebrains merged commit 98e34f7 into master Jun 11, 2026
20 checks passed
@mousebrains mousebrains deleted the chore/code-review-improvements branch June 11, 2026 04:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant