Skip to content

style: Convert leading spaces to tabs in Generals#2562

Open
bobtista wants to merge 6 commits intoTheSuperHackers:mainfrom
bobtista:bobtista/feat/access-spec-indent-generals
Open

style: Convert leading spaces to tabs in Generals#2562
bobtista wants to merge 6 commits intoTheSuperHackers:mainfrom
bobtista:bobtista/feat/access-spec-indent-generals

Conversation

@bobtista
Copy link
Copy Markdown

@bobtista bobtista commented Apr 9, 2026

Summary

  • Convert leading spaces/mixed whitespace to tabs, including access specifier indentation
  • All changes are whitespace-only (git diff -w is empty)
  • Uses tree-sitter-cpp for accurate C++ parsing with macro preprocessing

Access specifiers (public:/private:/protected:) are placed at the class
brace level, matching the existing codebase convention.

Script

The formatting script is included in the PR for reference but is not intended
to be merged — it shows how the changes were generated.

See scripts/cpp/convert_leading_spaces_to_tabs.py for details.

Part 2 of 4 — Generals/ (425 files).
See also: #2561, #2563, #2564.

@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Apr 9, 2026

Greptile Summary

This PR converts leading spaces (and mixed whitespace) to tabs across 425 C++ files in the Generals/ directory. All C++ file changes are purely whitespace — git diff -w is empty for those files — generated by a tree-sitter-based Python script. The new scripts/cpp/convert_leading_spaces_to_tabs.py file is included for reference as the script that produced the changes, though the PR description notes it is "not intended to be merged."

Confidence Score: 5/5

Safe to merge — all 425 C++ file changes are verified whitespace-only (git diff -w is empty for them), with no functional impact.

Every C++ change is a pure space-to-tab indentation conversion confirmed by git diff -w. The only substantive addition is the new Python script; the single finding (script included despite description saying otherwise) is P2 and does not block merge.

scripts/cpp/convert_leading_spaces_to_tabs.py — decide whether to keep or remove it from the branch.

Vulnerabilities

No security concerns identified.

Important Files Changed

Filename Overview
scripts/cpp/convert_leading_spaces_to_tabs.py New Python utility script (396 lines) that drives the whitespace conversion; PR description says it is not intended to be merged yet it is included as a new file in the changeset.
Generals/Code/GameEngine/Include/Common/BitFlags.h Whitespace-only change: leading spaces converted to tabs in member function bodies; functionally identical.
Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp Whitespace-only change: mixed-indentation lines (spaces, space+tab) normalised to tabs; git diff -w is empty.
Generals/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp Whitespace-only change: leading spaces to tabs throughout the file.
Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp Whitespace-only change: leading spaces to tabs; no functional modifications.
Prompt To Fix All With AI
This is a comment left during a code review.
Path: scripts/cpp/convert_leading_spaces_to_tabs.py
Line: 1

Comment:
**Script included despite "not intended to be merged"**

The PR description says this script is "not intended to be merged — it shows how the changes were generated," but the file is a new addition in the changeset and will land on `main` if the PR is accepted. If the intent is to keep it out of the codebase, remove it from the branch; if it's meant to be retained for future use by contributors, the description should say so.

How can I resolve this? If you propose a fix, please make it concise.

Reviews (2): Last reviewed commit: "fix: Handle braceless control-flow body ..." | Re-trigger Greptile

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