Skip to content

Make C++ indentation consistent (4 spaces, no tabs) - #391

Open
tameware wants to merge 1 commit into
dds-bridge:developfrom
tameware:indentation
Open

tameware wants to merge 1 commit into
dds-bridge:developfrom
tameware:indentation

Conversation

@tameware

@tameware tameware commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Normalize C++ sources to the documented 4-space / no-tabs style (fixes Make indentation consistent across the codebase #371).
  • Add a workspace full-tree scan in Linux CI plus hermetic unit tests for the indentation helpers.
  • Add .editorconfig so editors match the same defaults.

Test plan

  • python3 python/tests/cpp_indentation_test.py
  • bazelisk test //python:cpp_indentation_test
  • Smoke build //library/src:dds, //examples:solve_board, //web:dds_web_wasm
  • Confirm Linux CI “Check C++ indentation” step passes on this PR

Made with Cursor

Enforce the documented style with a workspace scan in Linux CI and hermetic unit tests, so agents and editors stay consistent without per-package source filegroups.

Co-authored-by: Cursor <cursoragent@cursor.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Fix the indentation conversion heuristics and expand scanning to the full repository tree.

Review effort: Lite
Findings: None

What changed in this PR

This PR standardizes C++ indentation to four spaces, removes tabs, and adds automated enforcement.

Changes:

  • Reformats C++ sources, tests, examples, and benchmarks.
  • Adds indentation tests, CI validation, and Bazel coverage.
  • Adds .editorconfig defaults.
File Description
wasm/​calc_dd_table_pbn_test.cpp Indentation cleanup
python/​src/​converters.cpp Whitespace cleanup
python/​src/​bindings.cpp Indentation cleanup
python/​BUILD.bazel Test target updates
library/​tests/​utility/​lookup_tables_test.cpp Indentation cleanup
library/​tests/​utility/​constants_test.cpp Indentation cleanup
library/​tests/​trans_table/​trans_table_p_test.cpp Indentation cleanup
library/​tests/​trans_table/​trans_table_base_test.cpp Indentation cleanup
library/​tests/​trans_table/​test_utilities.hpp Indentation cleanup
library/​tests/​trans_table/​mock_data_generators.hpp Indentation cleanup
library/​tests/​TestTimer.hpp Indentation cleanup
library/​tests/​system/​worker_count_test.cpp Indentation cleanup
library/​tests/​system/​utilities_stats_test.cpp Indentation cleanup
library/​tests/​system/​utilities_log_test.cpp Indentation cleanup
library/​tests/​system/​utilities_log_test_with_define.cpp Indentation cleanup
library/​tests/​system/​utilities_log_snapshot_test.cpp Indentation cleanup
library/​tests/​system/​utilities_log_ctx_ops_test.cpp Indentation cleanup
library/​tests/​system/​utilities_log_ctx_ops_test_with_define.cpp Indentation cleanup
library/​tests/​system/​utilities_log_contains_test.cpp Indentation cleanup
library/​tests/​system/​utilities_feature_flags_test.cpp Indentation cleanup
library/​tests/​system/​utilities_feature_flags_test_with_stats.cpp Indentation cleanup
library/​tests/​system/​utilities_feature_flags_test_with_log.cpp Indentation cleanup
library/​tests/​system/​tt_sharing_test.cpp Indentation cleanup
library/​tests/​system/​scheduler_board_time_test.cpp Indentation cleanup
library/​tests/​system/​deal_fanout_test.cpp Indentation cleanup
library/​tests/​quick_tricks/​next_suit_test.cpp Indentation cleanup
library/​tests/​heuristic_sorting/​targeted_unit_tests.cpp Indentation cleanup
library/​tests/​heuristic_sorting/​minimal_weight_test.cpp Indentation cleanup
library/​tests/​heuristic_sorting/​minimal_new_test.cpp Indentation cleanup
library/​tests/​heuristic_sorting/​merge_scratch_test.cpp Indentation cleanup
library/​tests/​fuzz/​solve_board_fuzz.cpp Indentation cleanup
library/​tests/​fuzz/​pbn_fuzz.cpp Indentation cleanup
library/​tests/​fuzz/​par_fuzz.cpp Indentation cleanup
library/​tests/​fuzz/​calc_dd_table_pbn_fuzz.cpp Indentation cleanup
library/​tests/​dtest.cpp Indentation cleanup
library/​tests/​dtest_parallel.hpp Indentation cleanup
library/​tests/​dtest_parallel.cpp Indentation cleanup
library/​tests/​dds_c_api_test.cpp Indentation cleanup
library/​tests/​cst.hpp Indentation cleanup
library/​tests/​context_equivalence.cpp Indentation cleanup
library/​tests/​compare.cpp Indentation cleanup
library/​tests/​compare_test.cpp Indentation cleanup
library/​tests/​ab_search/​ab_stats_test.cpp Indentation cleanup
library/​src/​trans_table/​trans_table_p.hpp Indentation cleanup
library/​src/​trans_table/​trans_table_p.cpp Indentation cleanup
library/​src/​table_deal_validate.hpp Indentation cleanup
library/​src/​system/​util/​utilities.hpp Indentation cleanup
library/​src/​system/​timer.hpp Indentation cleanup
library/​src/​system/​timer_list.hpp Indentation cleanup
library/​src/​system/​timer_list.cpp Indentation cleanup
library/​src/​system/​timer_group.hpp Indentation cleanup
library/​src/​system/​time_stat.hpp Indentation cleanup
library/​src/​system/​time_stat.cpp Indentation cleanup
library/​src/​system/​time_stat_list.hpp Indentation cleanup
library/​src/​system/​time_stat_list.cpp Indentation cleanup
library/​src/​system/​thread_mgr.hpp Indentation cleanup
library/​src/​system/​thread_data.hpp Indentation cleanup
library/​src/​system/​thread_data.cpp Indentation cleanup
library/​src/​system/​system.hpp Indentation cleanup
library/​src/​system/​parallel_boards.hpp Indentation cleanup
library/​src/​system/​memory.hpp Indentation cleanup
library/​src/​system/​memory.cpp Indentation cleanup
library/​src/​system/​file.hpp Indentation cleanup
library/​src/​system/​file.cpp Indentation cleanup
library/​src/​system/​deal_fanout.cpp Indentation cleanup
library/​src/​solver_if.hpp Indentation cleanup
library/​src/​solver_context_adapter.cpp Indentation cleanup
library/​src/​solve_board.hpp Indentation cleanup
library/​src/​quick_tricks.hpp Indentation cleanup
library/​src/​play_analyser.hpp Indentation cleanup
library/​src/​pbn.hpp Indentation cleanup
library/​src/​par_validate.hpp Indentation cleanup
library/​src/​lookup_tables/​lookup_tables.hpp Indentation cleanup
library/​src/​later_tricks.hpp Indentation cleanup
library/​src/​init.hpp Indentation cleanup
library/​src/​dump.hpp Indentation cleanup
library/​src/​dds.cpp Indentation cleanup
library/​src/​dds_api.cpp Indentation cleanup
library/​src/​calc_tables.hpp Indentation cleanup
library/​src/​api/​portab.h Indentation cleanup
library/​src/​api/​PBN.h Indentation cleanup
library/​src/​api/​dds.h Indentation cleanup
library/​src/​api/​dds_constants.hpp Indentation cleanup
library/​src/​api/​dds_c_data_types.h Indentation cleanup
library/​src/​api/​dds_c_api.h Indentation cleanup
library/​src/​api/​dds_c_api.cpp Indentation cleanup
library/​src/​api/​dds_api.hpp Indentation cleanup
library/​src/​ab_stats.hpp Indentation cleanup
examples/​solve_board.cpp Indentation cleanup
examples/​solve_board_pbn.cpp Indentation cleanup
examples/​solve_all_boards.cpp Indentation cleanup
examples/​par.cpp Indentation cleanup
examples/​hands.hpp Indentation cleanup
examples/​dealer_par.cpp Indentation cleanup
examples/​calc_dd_table.cpp Indentation cleanup
examples/​calc_dd_table_pbn.cpp Indentation cleanup
examples/​calc_all_tables.cpp Indentation cleanup
examples/​calc_all_tables_pbn.cpp Indentation cleanup
examples/​analyse_play_pbn.cpp Indentation cleanup
examples/​analyse_play_bin.cpp Indentation cleanup
examples/​analyse_all_plays_pbn.cpp Indentation cleanup
examples/​analyse_all_plays_bin.cpp Indentation cleanup
benchmarks/​replay.hpp Indentation cleanup
benchmarks/​recording.hpp Indentation cleanup
.github/​workflows/​ci_linux.yml Adds indentation scan
.editorconfig Defines formatting defaults

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@tameware
tameware requested a review from zzcgumn September 19, 2026 01:17
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.

Make indentation consistent across the codebase

2 participants