Skip to content

style: Put one element per line in long arrays for clang-format - #3407

Merged
xezon merged 2 commits into
TheSuperHackers:mainfrom
mirelle7:style/one-element-per-line-arrays
Oct 3, 2026
Merged

xezon merged 2 commits into
TheSuperHackers:mainfrom
mirelle7:style/one-element-per-line-arrays

Conversation

@mirelle7

@mirelle7 mirelle7 commented Oct 3, 2026

Copy link
Copy Markdown

Let Claude scan for all related arrays. personally picked all that made sense.

Another one flowing out of #2820

Reformat the wlib time name tables (DAYS, FULLDAYS, MONTHS, FULLMONTHS),
WindowStatusNames, WindowStyleNames and MAX_DISCONNECTS so that each element
is on its own line. This improves readability and keeps diffs small when an
entry is added, removed or commented out. No functional change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d7812190-c357-4e25-8ffd-c07001ebaab1
📥 Commits

Reviewing files that changed from the base of the PR and between 0ab9c41 and a649356.

📒 Files selected for processing (20)
  • Core/GameEngine/Include/GameClient/ParticleSys.h
  • Core/GameEngine/Source/GameLogic/AI/AIPathfind.cpp
  • Core/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/htree.cpp
  • Generals/Code/GameEngine/Source/Common/GameLOD.cpp
  • Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp
  • Generals/Code/GameEngine/Source/GameLogic/Object/Update/StealthDetectorUpdate.cpp
  • Generals/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp
  • Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptConditions.cpp
  • Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp
  • Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DProjectedShadow.cpp
  • GeneralsMD/Code/GameEngine/Source/Common/GameLOD.cpp
  • GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
  • GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/StealthDetectorUpdate.cpp
  • GeneralsMD/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp
  • GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp
  • GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptConditions.cpp
  • GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp
  • GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DProjectedShadow.cpp
  • GeneralsMD/Code/Tools/wdump/chunk_d.cpp

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.


Walkthrough

The changes reformat array and value initializers across game and tool code. Their entries and ordering remain unchanged, so the summaries show no runtime behavior changes.

Changes

Initializer formatting

Layer / File(s) Summary
Lookup tables and constants
Core/GameEngine/Source/GameClient/GUI/GameWindowManagerScript.cpp, Core/Tools/mangler/wlib/*, Core/Tools/matchbot/wlib/*, Core/GameEngine/Include/GameClient/ParticleSys.h, Generals*/Code/GameEngine/Source/Common/GameLOD.cpp, Generals*/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp, GeneralsMD/Code/Tools/wdump/chunk_d.cpp
Lookup tables, hardware-name arrays, shader labels, and MAX_DISCONNECTS use expanded multiline initializers. Their contents and ordering are unchanged.
Gameplay search and condition arrays
Core/GameEngine/Source/GameLogic/AI/AIPathfind.cpp, Generals*/Code/GameEngine/Source/GameLogic/Object/Update/StealthDetectorUpdate.cpp, Generals*/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp, Generals*/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp, Generals*/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptConditions.cpp
Pathfinding offsets, partition filters, and weapon-condition arrays use multiline initializers. Their values and ordering are unchanged.
Other engine and tool initializers
Core/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp, Core/Libraries/Source/WWVegas/WW3D2/htree.cpp, Generals*/Code/GameEngine/Source/GameClient/InGameUI.cpp, Generals*/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp, Generals*/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DProjectedShadow.cpp
Network arrays, pivot names, UI values, script lookup arrays, and UV coordinates use expanded multiline initializers. Their contents and ordering are unchanged.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Suggested reviewers: xezon

Merge Risk: ⚪ Minimal · up to a6493

This change only adjusts initializer layout; the reported values and ordering are unchanged, so no actionable merge risk is evident.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: formatting long arrays with one element per line.
Description check ✅ Passed The description refers to selecting related arrays for the formatting change and identifies this pull request as a continuation of #2820.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Low risk] Reformats array literals to match code style rules.

The PR appears safe to merge; the reviewed changes only reformat array initializers.

Summary

This PR reformats array initializers to place one element per line across shared engine code, both game variants, and development tools. The reviewed changes preserve the initializer values and their order.

Reviews (2) · Last reviewed commit: "style: Put one element per line in remai..."

@xezon xezon left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It is a nice change, but it is unexpected that it is just so little. Maybe it needs a search with a script?

For example just from the top of my head there are long line arrays in ParticleSys.h

Apply the one-element-per-line layout to the other string, identifier and
nested-row arrays that either exceed 100 columns or are wrapped, plus the
short sibling arrays in the same files so each file is consistent
(ParticleSys.h, chunk_d.cpp, the PartitionFilter lists, and so on).
Numeric lookup tables and arrays of identical entries are left as they are.
No functional change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@mirelle7

mirelle7 commented Oct 3, 2026

Copy link
Copy Markdown
Author

did a more complete search. i'm not sure about all these changes such as in Core/GameEngine/Source/GameLogic/AI/AIPathfind.cpp

would love to hear

@xezon

xezon commented Oct 3, 2026 •

Copy link
Copy Markdown

Core/GameEngine/Source/GameLogic/AI/AIPathfind.cpp

The file is 11.000 lines. Can you be more specific?

Edit: Ok I understand after looking at the diff

@xezon xezon left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks fine to me.

@xezon xezon added the Refactor Edits the code with insignificant behavior changes, is never user facing label Oct 3, 2026
@xezon
xezon merged commit 1e39288 into TheSuperHackers:main Oct 3, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactor Edits the code with insignificant behavior changes, is never user facing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants