mirror of
https://github.com/syoyo/tinygltf.git
synced 2026-08-02 11:28:54 +00:00
2.7 KiB
2.7 KiB
AGENTS.md — tinygltf v3 (C)
TinyGLTF v3 C (tiny_gltf_v3.h + tiny_gltf_v3.c + tinygltf_json_c.h) is the
mainline. Legacy v1/v2/v3-C++ code lives under attic/ and is not built or
tested.
Commands
- Unit tests (C):
make -C tests all && make -C tests run - CMake:
cmake -B build -DTINYGLTF3_BUILD_TESTS=ON && cmake --build build && ctest --test-dir build --output-on-failure - Meson:
meson setup build && meson compile -C build && meson test -C build - WASM/web demo (requires Emscripten SDK, default
~/work/emsdk):make -C web && make -C web sample— then openhttp://localhost:8000viamake -C web serve - Fuzzers:
make -C tests/v3/fuzzer(clang + libFuzzer)
Pre-push audit checklist
Run before every push. Fix or unstage anything found; the audit must pass clean.
-
Working tree sanity
git status --short— no staged build artifacts, no surprise files.- Never
git add -A/git add .: stage only intended paths. The repo root frequently contains untracked scratch files (Fox.glb,benchmark/synthetic_*,log*,.cache/,tests/v3/fuzzer/artifacts|corpus, stray*.gltf/*.binfiles). Verifygit statusbefore staging.
-
Secret scan
gitleaks detect --source . --no-banner -r /tmp/gitleaks.json~/local/bin/trufflehog git file://$PWD --no-update --only-verified- Both must report 0 real secrets. Known allowed finding:
B3G_LEFT_ARROWgeneric-api-key hits inattic/examples/common/OpenGLWindow/are false positives (keyboard key constants).
-
No build artifacts or unwanted large binaries
git ls-files -z | xargs -0 du -b | sort -rn | head -30— review the top.- Rule of thumb: nothing over ~1 MB unless it is a tracked, intentional
asset (e.g.
attic/tools/windows/premake5.exe,models/Cube/*.png). - Watch for: compiled executables,
*.wasm/*.exr/*.log/*.o/*.obj, generatedoutput.*/cloth*/sim*.bin/out_*.exrfiles, and large.gltf/.glbfiles. Small test/regression fixture.gltffiles (e.g. undertests/,models/regression/,tests/v3/security/) are OK. web/tinygltf_v3.js,web/tinygltf_v3.wasm,web/Cube.glbare generated bymake -C weband must stay gitignored (never commit them).
-
History is lean
- If an unwanted file was added in an unpushed commit, rewrite it
(
git rebase -i origin/<branch>,git rm+--amend) so the blob never reaches the remote, thengit gc --prune=nowlocally. - Push only intended branches (
git push origin <branch>— never--allor--forceunless explicitly asked).
- If an unwanted file was added in an unpushed commit, rewrite it
(
-
Final smoke check
make -C tests runpasses (all 4 testers).- If touched:
cmake/mesonbuilds andmake -C webstill succeed.