Skip to content

Commit

Permalink
Change vNext format for max columns to 120 (#3497)
Browse files Browse the repository at this point in the history
* change clang format column count to 120

* Change files

* add clang format
  • Loading branch information
asklar committed Oct 23, 2019
1 parent 5c77dc8 commit ce0f4a3
Show file tree
Hide file tree
Showing 397 changed files with 10,652 additions and 15,449 deletions.
9 changes: 9 additions & 0 deletions change/react-native-windows-2019-10-23-14-41-41-clang120.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "none",
"comment": "change clang format column count to 120",
"packageName": "react-native-windows",
"email": "asklar@winse.microsoft.com",
"commit": "a1e10087ad39b3c4f26a806a50acdcf719056ba6",
"date": "2019-10-23T21:41:41.845Z",
"file": "F:\\rnw\\change\\react-native-windows-2019-10-23-14-41-41-clang120.json"
}
92 changes: 92 additions & 0 deletions vnext/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
AccessModifierOffset: -1
AlignAfterOpenBracket: AlwaysBreak
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: false
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: false
ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [ FOR_EACH_RANGE, FOR_EACH, ]
IncludeBlocks: Preserve
IncludeCategories:
- Regex: 'pch.h'
Priority: -1
- Regex: '.*\.g\..*'
Priority: 1
- Regex: '^<.*\.h(pp)?>'
Priority: 2
- Regex: '^<.*'
Priority: 3
- Regex: '.*'
Priority: 4
IndentCaseLabels: true
IndentWidth: 2
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 8
UseTab: Never
...
43 changes: 13 additions & 30 deletions vnext/Chakra/ChakraCoreDebugger.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ class DebugProtocolHandler {
DebugProtocolHandler(JsRuntimeHandle runtime) {
JsDebugProtocolHandler protocolHandler;

JsErrorCode result =
JsDebugProtocolHandlerCreate(runtime, &protocolHandler);
JsErrorCode result = JsDebugProtocolHandlerCreate(runtime, &protocolHandler);

if (result != JsNoError) {
throw new std::runtime_error("Unable to create debug protocol handler.");
Expand All @@ -30,12 +29,8 @@ class DebugProtocolHandler {
Destroy();
}

JsErrorCode Connect(
bool breakOnNextLine,
JsDebugProtocolHandlerSendResponseCallback callback,
void *callbackState) {
JsErrorCode result = JsDebugProtocolHandlerConnect(
m_protocolHandler, breakOnNextLine, callback, callbackState);
JsErrorCode Connect(bool breakOnNextLine, JsDebugProtocolHandlerSendResponseCallback callback, void *callbackState) {
JsErrorCode result = JsDebugProtocolHandlerConnect(m_protocolHandler, breakOnNextLine, callback, callbackState);

return result;
}
Expand Down Expand Up @@ -65,31 +60,25 @@ class DebugProtocolHandler {
}

JsErrorCode ProcessCommandQueue() {
JsErrorCode result =
JsDebugProtocolHandlerProcessCommandQueue(m_protocolHandler);
JsErrorCode result = JsDebugProtocolHandlerProcessCommandQueue(m_protocolHandler);

return result;
}

JsErrorCode SetCommandQueueCallback(
JsDebugProtocolHandlerCommandQueueCallback callback,
void *callbackState) {
JsErrorCode result = JsDebugProtocolHandlerSetCommandQueueCallback(
m_protocolHandler, callback, callbackState);
JsErrorCode SetCommandQueueCallback(JsDebugProtocolHandlerCommandQueueCallback callback, void *callbackState) {
JsErrorCode result = JsDebugProtocolHandlerSetCommandQueueCallback(m_protocolHandler, callback, callbackState);

return result;
}

JsErrorCode WaitForDebugger() {
JsErrorCode result =
JsDebugProtocolHandlerWaitForDebugger(m_protocolHandler);
JsErrorCode result = JsDebugProtocolHandlerWaitForDebugger(m_protocolHandler);

return result;
}

JsErrorCode GetConsoleObject(JsValueRef *consoleObject) {
JsErrorCode result = JsDebugProtocolHandlerCreateConsoleObject(
m_protocolHandler, consoleObject);
JsErrorCode result = JsDebugProtocolHandlerCreateConsoleObject(m_protocolHandler, consoleObject);

return result;
}
Expand Down Expand Up @@ -142,22 +131,16 @@ class DebugService {
return result;
}

JsErrorCode RegisterHandler(
std::string const &runtimeName,
DebugProtocolHandler &protocolHandler,
bool breakOnNextLine) {
JsErrorCode result = JsDebugServiceRegisterHandler(
m_service,
runtimeName.c_str(),
protocolHandler.GetHandle(),
breakOnNextLine);
JsErrorCode
RegisterHandler(std::string const &runtimeName, DebugProtocolHandler &protocolHandler, bool breakOnNextLine) {
JsErrorCode result =
JsDebugServiceRegisterHandler(m_service, runtimeName.c_str(), protocolHandler.GetHandle(), breakOnNextLine);

return result;
}

JsErrorCode UnregisterHandler(std::string const &runtimeName) {
JsErrorCode result =
JsDebugServiceUnregisterHandler(m_service, runtimeName.c_str());
JsErrorCode result = JsDebugServiceUnregisterHandler(m_service, runtimeName.c_str());

return result;
}
Expand Down
Loading

0 comments on commit ce0f4a3

Please sign in to comment.