forked from electronicarts/CnC_Generals_Zero_Hour
-
Notifications
You must be signed in to change notification settings - Fork 189
style: apply automated formatting baseline with clang-format #2638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
DevGeniusCode
wants to merge
7
commits into
TheSuperHackers:main
Choose a base branch
from
DevGeniusCode:clang/step1-whitespace
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a929585
style: Add Clang-Format configuration file
DevGeniusCode 9ddb58a
style: Clean up whitespace and formatting across `\Core\GameEngine` f…
DevGeniusCode a7b9c5e
style: fix legacy CPP_11 macro handling
DevGeniusCode 75c5338
style: Update Clang-Format on/off and preserve formatting for legacy …
DevGeniusCode c3de519
style: fix UseTab to AlignWithSpaces
DevGeniusCode a72ba2e
style: adjust trailing comment alignment to 4 spaces
DevGeniusCode 14366de
style: standardize assignment operator initialization formatting
DevGeniusCode File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| # ============================================================================== | ||
| # Minimalist Clang-Format Configuration (Baseline) | ||
| # ============================================================================== | ||
| # ============================================================================== | ||
| # CUSTOM CLANG-FORMAT OFF FLAGS | ||
| # When disabling clang-format, please use one of the following standard flags | ||
| # to explain why, making it easier to search and maintain the codebase: | ||
| # | ||
| # Usage: // clang-format off: [FLAG_NAME] - optional details | ||
| # | ||
| # Available Flags: | ||
| # [LEGACY_VC6] - For strict C++03 / VC6 compiler compatibility. | ||
| # [MACRO_COMPACT] - To prevent concise macros from multi-line wrapping. | ||
| # [MACRO_INDENT] - When the formatter messes up a macro's internal indentation. | ||
| # [TABLE_ALIGN] - For matrices, lookup tables, and 2D arrays alignment. | ||
| # [MATH_ALIGN] - For preserving manual spaces in complex math/logic formulas. | ||
| # [X_MACRO] - For structured X-Macro lists. | ||
| # [INLINE_ASM] - For preserving inline assembly instruction formatting. | ||
| # [BITFIELD_ALIGN] - For aligning bitfield sizes (:) in structs / hardware maps. | ||
| # [BITMASK_ALIGN] - For visual alignment of bitwise operations and bit flags. | ||
| # ============================================================================== | ||
| Language: Cpp | ||
| Standard: c++20 | ||
|
|
||
| # 1. Non-Destructive Core Setting | ||
| # ------------------------------------------------------------------------------ | ||
| # Completely disable automatic line wrapping to preserve manual formatting. | ||
| ColumnLimit: 0 | ||
|
greptile-apps[bot] marked this conversation as resolved.
|
||
|
|
||
| # 2. Indentation & Tabs | ||
| # ------------------------------------------------------------------------------ | ||
| UseTab: AlignWithSpaces | ||
| IndentWidth: 2 | ||
| TabWidth: 2 | ||
| ContinuationIndentWidth: 2 | ||
| AccessModifierOffset: -2 | ||
| IndentCaseLabels: true | ||
| AlignTrailingComments: false | ||
| SpacesBeforeTrailingComments: 4 | ||
|
|
||
| # 3. Braces Style: Allman | ||
| # ------------------------------------------------------------------------------ | ||
| BreakBeforeBraces: Custom | ||
| BraceWrapping: | ||
| AfterCaseLabel: true | ||
| AfterClass: true | ||
| AfterControlStatement: Always | ||
| AfterEnum: true | ||
| AfterFunction: true | ||
| AfterNamespace: true | ||
| AfterStruct: true | ||
| AfterUnion: true | ||
| BeforeCatch: true | ||
| BeforeElse: true | ||
| IndentBraces: false | ||
| SplitEmptyFunction: false | ||
| SplitEmptyRecord: false | ||
| AllowShortEnumsOnASingleLine: false | ||
|
|
||
| # 4. Pointers & Spaces | ||
| # ------------------------------------------------------------------------------ | ||
| PointerAlignment: Left | ||
| SpacesInParentheses: false | ||
| BreakConstructorInitializers: BeforeComma | ||
|
|
||
| # 5. Legacy & Compatibility (VC6 / Custom Macros) | ||
| # ------------------------------------------------------------------------------ | ||
| # Prevent expanding/collapsing short blocks and functions to minimize diffs | ||
| AllowShortFunctionsOnASingleLine: All | ||
| AllowShortBlocksOnASingleLine: Always | ||
|
DevGeniusCode marked this conversation as resolved.
|
||
| AlignEscapedNewlines: Left | ||
|
|
||
| # Handle custom legacy macros so the parser doesn't break | ||
| Macros: | ||
| - CPP_11(x)=x | ||
|
|
||
| IndentPPDirectives: BeforeHash | ||
| ConstructorInitializerIndentWidth: 2 | ||
|
|
||
| # 6. Includes | ||
| # ------------------------------------------------------------------------------ | ||
| SortIncludes: false | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,4 +22,4 @@ namespace addon | |
| { | ||
| extern Bool HasFullviewportDat(); | ||
|
|
||
| } // namespace addon | ||
| } // namespace addon | ||
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.