Adopt Tap House Rules (shared C++ style)#32
Open
tap wants to merge 11 commits into
Open
Conversation
Family-wide C++ style copied verbatim from the Tap House Rules: .clang-format (layout), .clang-tidy (identifier naming + mandatory braces), STYLE.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HYVHCW3W42rtAARnzPo9Zg
Mechanical reformat: namespace indentation, alignment, 120-column reflow, attached braces, include-group reordering. No semantic changes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HYVHCW3W42rtAARnzPo9Zg
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HYVHCW3W42rtAARnzPo9Zg
Rename all types, functions, methods, variables, members, concepts, and enumerators to snake_case; private/protected data members take the m_ prefix. Bulk-applied with clang-tidy readability-identifier-naming; the concept/traits/dependent-type uses clang-tidy cannot resolve (sample_type, sample_traits<T>::coeff/accum, make_coeff, etc.) and designated-initializer designators were completed by hand. Resolved three genuine type<->accessor collisions that snake_casing creates: State -> converter_state (vs the .state field), Status -> converter_status (vs the status() method), and pi_servo::Stage -> lock_stage (vs the stage() method). The ergonomic accessors (.state, .status(), .stage()) are kept. Also fixes the shared .clang-tidy: add EnumConstantCase/ScopedEnumConstantCase (scoped enumerators were unenforced) and broaden HeaderFilterRegex to include tests/ so test-support headers are covered. Verified: clean build, 70/70 tests pass, clang-tidy identifier-naming clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HYVHCW3W42rtAARnzPo9Zg
Apply clang-tidy readability-braces-around-statements across the codebase; every if/for/while body is braced and expanded. Verified: 70/70 tests pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HYVHCW3W42rtAARnzPo9Zg
Rename headers .hpp -> .h and update every include; replace #ifndef/#define/#endif guards with #pragma once; convert the \file/\brief banner dialect to @file/@brief and add an SPDX-License-Identifier + copyright line to each file. Doc/CI/script references to the old paths updated too. Verified: clean build, 70/70 tests pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HYVHCW3W42rtAARnzPo9Zg
Permit multi-capital matrix products (DtD, YtD, DY) in the linear-algebra carve-out, keeping the shared config byte-identical across the Tap family. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HYVHCW3W42rtAARnzPo9Zg
Rename type, method, field, and constant references throughout the ASRC book, README, and docs to match the Tap House Rules migration (SpscRing -> spsc_ring, writeAvailable -> write_available, numPhases -> num_phases, ...). The three collision types read as their new names (State -> converter_state, Status -> converter_status, Config -> config), and the cpp-decisions.md appendix explains them. Template parameters (PopFn) correctly stay PascalCase.
The {{#include}} ANCHOR directives already point at the renamed .h files and auto-extract the current code; verified all 80 resolve (path + anchor present). SVG figures are separate files and untouched.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HYVHCW3W42rtAARnzPo9Zg
drift job checks configs against canonical TapHouse; clang-tidy job enforces naming + mandatory braces over the project's own TUs. clang-format already enforced in ci.yml. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HYVHCW3W42rtAARnzPo9Zg
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HYVHCW3W42rtAARnzPo9Zg
The earlier passes missed tools/capi (srt_capi.cpp/.h), tools/qemu_insn_plugin, and platform/ — all of which SampleRateTap's clang-format CI checks. Reformat them and add SPDX banners. tools/capi/srt_capi.cpp consumes the public API, so its identifier references are migrated to snake_case (srt::Config -> srt::config, srt::AsyncSampleRateConverter -> srt::async_sample_rate_converter, srt::Status -> srt::converter_status, camelCase methods/fields -> snake_case); verified it compiles against the renamed headers. Verified: clang-format clean over the CI file set, 70/70 tests pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HYVHCW3W42rtAARnzPo9Zg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Applies the shared Tap House Rules (canonical in tap/TapHouse). Reviewable commits:
.clang-format,.clang-tidy,STYLE.md).git-blame-ignore-revs)m_, concepts, enumerators).hpp → .h,#pragma once, SPDX banners.clang-tidysync (broadened math carve-out to match AmbiTap)Notable: three genuine collisions resolved
Snake-casing the PascalCase types created real C++ name clashes with their accessors. Resolved by renaming the types and keeping the ergonomic accessors:
State→converter_state(vs the.statefield)Status→converter_status(vs thestatus()method)PiServo::Stage→lock_stage(vs thestage()method)Verification
{{#include}}ANCHOR directives already point at the renamed.hfiles and auto-extract the current code — all 80 verified to resolve.cpp-decisions.mdexplains the collision renames; template params (PopFn) correctly stay PascalCase.CI
Adds
.github/workflows/style.yml: TapHouse drift check (@v1) + clang-tidy enforcement. clang-format already enforced inci.yml.🤖 Generated with Claude Code
https://claude.ai/code/session_01HYVHCW3W42rtAARnzPo9Zg
Generated by Claude Code