Created
March 15, 2018 04:36
-
-
Save CFSworks/42be608c5ead2251542163e3b97b66b2 to your computer and use it in GitHub Desktop.
WIP Panda3D clang-format rules
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
# Indentation | |
UseTab: Never | |
IndentWidth: 2 | |
ContinuationIndentWidth: 2 | |
ConstructorInitializerIndentWidth: 2 | |
# Spaces | |
SpaceAfterTemplateKeyword: false | |
#SpaceBeforeInheritanceColon: true | |
SpaceBeforeParens: ControlStatements | |
# Alignment | |
AlignConsecutiveAssignments: true | |
#AlignConsecutiveDeclarations: true | |
AlignEscapedNewlines: Left | |
AlignOperands: true | |
PointerAlignment: Right | |
# Single-line | |
AllowShortFunctionsOnASingleLine: Inline | |
AllowShortIfStatementsOnASingleLine: true | |
# Inserting breaks | |
AlwaysBreakTemplateDeclarations: true | |
BreakConstructorInitializers: AfterColon | |
ConstructorInitializerAllOnOneLineOrOnePerLine: true | |
BreakBeforeBraces: Custom | |
BraceWrapping: | |
SplitEmptyFunction: false | |
# Continuation | |
IndentWrappedFunctionNames: true | |
BinPackParameters: true | |
# Penalties | |
PenaltyBreakBeforeFirstCallParameter: 1000 | |
PenaltyReturnTypeOnItsOwnLine: 100 | |
PenaltyBreakFirstLessLess: 0 | |
PenaltyExcessCharacter: 3 | |
# Includes | |
#IncludeBlocks: Regroup | |
IncludeIsMainRegex: "$" | |
IncludeCategories: | |
- Regex: 'pandabase.h' | |
Priority: -1 | |
- Regex: 'dtoolbase.h' | |
Priority: -1 | |
# Main header, priority 0 | |
# #include "foo.h" | |
- Regex: '^"' | |
Priority: 1 | |
# #include <foo.h> | |
- Regex: '^<' | |
Priority: 2 |
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
#!/bin/sh | |
set -euo pipefail | |
sed -i 's/\(PT\)(\([A-Za-z0-9_]*\))/\1__\2/g' $* | |
sed -i 's/PUBLISHED:/public:\/\/actuallypublished/' $* | |
clang-format -i $* | |
sed -i 's/public:.*actuallypublished/PUBLISHED:/' $* | |
sed -i 's/PT__\([A-Za-z0-9_]*\)/PT(\1)/g' $* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment