Skip to content

v2 README docs, static analysis CI, expanded tests, and non-finite wire fixes#6

Merged
Rochet2 merged 14 commits into
masterfrom
release/readme-v2
May 31, 2026
Merged

v2 README docs, static analysis CI, expanded tests, and non-finite wire fixes#6
Rochet2 merged 14 commits into
masterfrom
release/readme-v2

Conversation

@Rochet2

@Rochet2 Rochet2 commented May 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • README: Fix SMALLFOLK_BUILD_TESTS typo, link CHANGELOG.md, and document v2 APIs (safe lookup, path API, loads_or_throw / dumps_or_throw, typed accessors, lua_val factories, static analysis usage).
  • Static analysis: Add .clang-tidy, cmake/StaticAnalysis.cmake, cppcheck-suppressions.txt, and an Ubuntu CI job running cppcheck + clang-tidy.
  • Tests: Expand test_smallfolk.cpp and test_schema.cpp (nil/setignore/copy/insert/remove, path errors, schema depth limits, etc.) and add fixed gvx/Lua Smallfolk wire interop fixtures in test_lua_smallfolk_interop_wires().
  • Non-finite wire: Harden NaN/Inf serialization to gvx token form (N/Q/I/i) so glibc/libstdc++ round-trips correctly on Linux/macOS; parse nan text and use std::nan for N/Q tokens.
  • Comments: Restore pre-v2 API/serializer comments in smallfolk.h and smallfolk.cpp.
  • CI fixes: Build full test targets before ctest in the static-analysis job; relax clang-tidy warnings-as-errors for legacy sources; fix schema depth-limit test dangling temporary on GCC.

Test plan

  • Ubuntu / macOS / Windows build + ctest
  • static-analysis job (cppcheck, clang-tidy, ctest)
  • smallfolk_tests — non-finite round-trip and Lua wire interop fixtures
  • smallfolk_schema_tests — depth-limit validation on GCC

Rochet2 added 12 commits May 31, 2026 22:41
Run cppcheck and clang-tidy on Ubuntu via smallfolk_static_analysis targets, with optional SMALLFOLK_ENABLE_CLANG_TIDY for build-time checks. Add tests for setignore, nil semantics, copy depth, insert/remove, load limit globals, path errors, schema one_of initializer_list, validation depth limits, and loads_validated limit overloads.
Ensure non-finite values always serialize as N/Q/I/i tokens instead of nan/inf text that the parser misreads as nil, and add fixed gvx wire fixtures for cross-implementation checks.
Use fpclassify and snprintf fallbacks so NaN/Inf never stream as nan/inf text, and construct non-finite test values with numeric_limits instead of 0/0.
Map libc nan/inf text to N/Q/I/i like the original serializer instead of mis-encoding unrecognized NaN strings as +inf on glibc.
Match gvx Smallfolk NaN dump via tostring sign, parse N/Q with runtime 0/0 like Lua, check isnan before isfinite when encoding, and suppress intentional cppcheck findings on the header-library API.
Drop cppcheck style checks that fail on the public LuaVal API, assert exact non-finite wire tokens, and use isnan-safe comparisons in tests.
Stop treating all clang-tidy warnings as errors on legacy library sources, parse N/Q via std::nan, and rely on round-trip isnan checks instead of exact wire bytes that vary by libc NaN formatting.
Keep nested array schemas in static storage so CompiledSchema does not bind to a destroyed temporary, which caused validation to spuriously pass on Linux/macOS.
@Rochet2 Rochet2 changed the title Document v2 API in README and fix build option typo v2 README docs, static analysis CI, expanded tests, and non-finite wire fixes May 31, 2026
Rochet2 added 2 commits June 1, 2026 00:17
Record README and static-analysis additions, Linux/macOS non-finite wire fix, and expanded test coverage pending the next release tag.
Rename the unreleased section to 2.0.1 (2026-05-31) and align CMake/README version strings.
@Rochet2 Rochet2 merged commit 750580d into master May 31, 2026
8 checks passed
@Rochet2 Rochet2 deleted the release/readme-v2 branch May 31, 2026 21:19
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