Full-codebase formatting, clang-tidy, and include unification - #213
Conversation
|
Hi, thx. How about adding a test to the CI ? E.g. https://github.com/webmproject/libsmpte2094-50/blob/a8ec3fc61b9ed0719b32a198816804dbb3b6da82/.github/workflows/ci-format-check.yml#L13-L22 |
yes please! |
Good call, done. |
|
i don't agree with all the clang formatting (like when semantically-close params are decoupled. e.g. "int width, int height") but there's certainly a value in unified and automated clang-format treatment. submitting. |
This change applies a comprehensive pass of
clang-formatandclang-tidycleanups across the repository, unifies C standard library header inclusions, and introduces automated CI formatting enforcement.Summary of Changes:
Clang-Format:
kZigzag,kInvZigzag, andkDefaultMatricesinsrc/quantize.ccwith exactly 8 elements per row, protected by// clang-format off/// clang-format onblocks to preserve matrix layout.src/score_7.ccprotected from reformatting.Automated CI Format Check (
.github/workflows/ci-format-check.yml):RafikFarhad/clang-format-github-action@v7to enforceclang-formaton all.ccand.hfiles across push and PR events, with automatic PR concurrency cancellation.Clang-Tidy Configuration (
.clang-tidy):.clang-tidyfile enabling standard upstream checks:bugprone-*,google-*,misc-*,modernize-*,performance-*,portability-*, andreadability-*.nullptrmodernizations, explicit constructors, and unused declarations.Include Cleanup (IWYU pass):
<stdlib.h>,<assert.h>,<algorithm>,<vector>).src/andexamples/.IWYU pragma: exportinsrc/sjpegi.h(forsimd.h,sjpeg.h,bit_writer.h) andkeeppragmas inexamples/vjpeg.ccto keep automated include analyzers clean in future PRs.Header Style Unification:
<*.h>style across the codebase (e.g.,<stdint.h>,<stdlib.h>,<assert.h>,<math.h>,<limits.h>), matching existing predominant repository usage.Testing:
cmake --build build -j).unit_test,test_cmd,test_png_jpg).clang-tidyrun across all translation units.CI Format Checkpasses green on GitHub Actions.