-
Notifications
You must be signed in to change notification settings - Fork 264
cppwinrt code base should have clang-format style formatting enforced automatically #1461
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
Closed
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
bf6e0ea
Squash infrastructure changes before reformatting from scratch again
dmachaj 0fb6876
Fix bug where build_test_all was wasting time formatting generated he…
dmachaj 7abe7b3
Fix up format script to work better when there are obj directories fl…
dmachaj 70985d7
It helps if you push the modified files
dmachaj 2017f1d
For some reason one (and only one) file was not formatted by the form…
dmachaj d101e72
Change AlignAfterOpenBracket: Align and reformat all files
dmachaj cfbf362
Add a clang-format-ignore and suppress/revert a few files that are no…
dmachaj 58e2f19
Remove unused setlocal from build_test_all.cmd
dmachaj 28db1a8
Add a .editorconfig that should more or less align with the .clang-fo…
dmachaj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
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,163 @@ | ||
| --- | ||
| Language: Cpp | ||
| BasedOnStyle: Microsoft | ||
|
|
||
| AccessModifierOffset: -4 | ||
| AlignAfterOpenBracket: Align | ||
| AlignConsecutiveAssignments: false | ||
| AlignEscapedNewlines: DontAlign | ||
| AlignOperands: true | ||
| AlignTrailingComments: true | ||
| AllowAllParametersOfDeclarationOnNextLine: true | ||
| AllowShortBlocksOnASingleLine: false | ||
| AllowShortLambdasOnASingleLine: Inline | ||
| AlwaysBreakBeforeMultilineStrings: true | ||
| AlwaysBreakTemplateDeclarations: MultiLine | ||
| BinPackArguments: false | ||
| BinPackParameters: false | ||
| BraceWrapping: | ||
| AfterCaseLabel: true | ||
| AfterUnion: true | ||
| BeforeLambdaBody: true | ||
| SplitEmptyFunction: false | ||
| SplitEmptyRecord: false | ||
| SplitEmptyNamespace: false | ||
| BreakBeforeBinaryOperators: None | ||
| BreakBeforeTernaryOperators: true | ||
| BreakConstructorInitializers: AfterColon | ||
| BreakStringLiterals: false | ||
| CommentPragmas: '^ IWYU pragma:' | ||
| CompactNamespaces: true | ||
| ConstructorInitializerAllOnOneLineOrOnePerLine: true | ||
| ConstructorInitializerIndentWidth: 4 | ||
| ContinuationIndentWidth: 4 | ||
| Cpp11BracedListStyle: false | ||
| DerivePointerAlignment: false | ||
| DisableFormat: false | ||
| FixNamespaceComments: true | ||
| ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] | ||
| IncludeBlocks: Regroup | ||
| IndentCaseLabels: false | ||
| IncludeCategories: | ||
| - Regex: '^"(stdafx.h|pch.h|precomp.h)"$' | ||
| Priority: -1 | ||
| IndentWrappedFunctionNames: false | ||
| KeepEmptyLinesAtTheStartOfBlocks: true | ||
| MacroBlockBegin: '^BEGIN_COM_MAP$|^BEGIN_CONNECTION_POINT_MAP$|^BEGIN_HELPER_NODEMAP$|^BEGIN_MODULE$|^BEGIN_MSG_MAP$|^BEGIN_OBJECT_MAP$|^BEGIN_TEST_CLASS$|^BEGIN_TEST_METHOD$|^BEGIN_TEST_METHOD_PROPERTIES$' | ||
| MacroBlockEnd: '^END_COM_MAP$|^END_CONNECTION_POINT_MAP$|^END_HELPER_NODEMAP$|^END_MODULE$|^END_MSG_MAP$|^END_OBJECT_MAP$|^END_TEST_CLASS$|^END_TEST_METHOD$|^END_TEST_METHOD_PROPERTIES$' | ||
| MaxEmptyLinesToKeep: 1 | ||
| NamespaceIndentation: All | ||
| ObjCBlockIndentWidth: 2 | ||
| ObjCSpaceAfterProperty: false | ||
| ObjCSpaceBeforeProtocolList: true | ||
| PackConstructorInitializers: NextLineOnly | ||
| PenaltyBreakBeforeFirstCallParameter: 19 | ||
| PenaltyBreakComment: 300 | ||
| PenaltyBreakFirstLessLess: 120 | ||
| PenaltyBreakString: 2000 | ||
| PenaltyExcessCharacter: 2 | ||
| PointerAlignment: Left | ||
| SortIncludes: false | ||
| SpaceAfterCStyleCast: false | ||
| SpaceBeforeAssignmentOperators: true | ||
| SpaceBeforeParens: ControlStatements | ||
| SpaceInEmptyParentheses: false | ||
| SpacesBeforeTrailingComments: 1 | ||
| SpacesInAngles: Never | ||
| SpacesInContainerLiterals: true | ||
| SpacesInCStyleCastParentheses: false | ||
| SpacesInParentheses: false | ||
| SpacesInSquareBrackets: false | ||
| Standard: Latest | ||
|
|
||
| AttributeMacros: [ | ||
| CALLBACK, | ||
| ] | ||
|
|
||
| StatementMacros: [ | ||
| _Acquires_exclusive_lock_, | ||
| _Acquires_lock_, | ||
| _Acquires_nonreentrant_lock_, | ||
| _Acquires_shared_lock_, | ||
| _Analysis_assume_smart_lock_acquired_, | ||
| _Analysis_assume_smart_lock_released_, | ||
| _Create_lock_level_, | ||
| _Detaches_lock_, | ||
| _Function_class_, | ||
| _Global_cancel_spin_lock_, | ||
| _Global_critical_region_, | ||
| _Global_interlock_, | ||
| _Global_priority_region_, | ||
| _Has_lock_kind_, | ||
| _Has_lock_level_, | ||
| _IRQL_always_function_max_, | ||
| _IRQL_always_function_min_, | ||
| _IRQL_raises_, | ||
| _IRQL_requires_, | ||
| _IRQL_requires_max_, | ||
| _IRQL_requires_min_, | ||
| _IRQL_requires_same_, | ||
| _IRQL_restores_, | ||
| _IRQL_restores_global_, | ||
| _IRQL_saves_, | ||
| _IRQL_saves_global_, | ||
| _Lock_level_order_, | ||
| _Moves_lock_, | ||
| _Must_inspect_result_, | ||
| _No_competing_thread_, | ||
| _Post_same_lock_, | ||
| _Post_writable_byte_size_, | ||
| _Pre_satisfies_, | ||
| _Releases_exclusive_lock_, | ||
| _Releases_lock_, | ||
| _Releases_nonreentrant_lock_, | ||
| _Releases_shared_lock_, | ||
| _Replaces_lock_, | ||
| _Requires_exclusive_lock_held_, | ||
| _Requires_lock_held_, | ||
| _Requires_lock_not_held_, | ||
| _Requires_no_locks_held_, | ||
| _Requires_shared_lock_held_, | ||
| _Ret_maybenull_, | ||
| _Ret_range_, | ||
| _Struct_size_bytes_, | ||
| _Success_, | ||
| _Swaps_locks_, | ||
| _Use_decl_annotations_, | ||
| _When_, | ||
|
|
||
| DECLARE_ORDINAL_MAP, | ||
| DECLARE_PROCNAME_MAP, | ||
| DEFINE_ORDINAL_ENTRIES, | ||
| DEFINE_ORDINAL_ENTRIES_ALTNAME, | ||
| DEFINE_ORDINAL_ENTRIES_APISET, | ||
| DEFINE_ORDINAL_MAP, | ||
| DEFINE_PROCNAME_ENTRIES, | ||
| DEFINE_PROCNAME_ENTRIES_ALTNAME, | ||
| DEFINE_PROCNAME_ENTRIES_APISET, | ||
| DEFINE_PROCNAME_MAP, | ||
| DLOENTRY, | ||
| DLOENTRY_APISET, | ||
| DLPENTRY, | ||
| DLPENTRY_APISET, | ||
|
|
||
| RpcEndExcept, | ||
|
|
||
| ActivatableClass, | ||
| ActivatableClassWithFactory, | ||
| ActivatableClassWithFactoryEx, | ||
| ActivatableStaticOnlyFactory, | ||
| ActivatableStaticOnlyFactoryEx, | ||
| CoCreatableClass, | ||
| CoCreatableClassWithFactory, | ||
| CoCreatableClassWithFactoryEx, | ||
|
|
||
| TEST_CASE, | ||
| SECTION, | ||
| ] | ||
|
|
||
| TypenameMacros: [ | ||
| IFACEMETHOD, | ||
| STDMETHOD, | ||
| STDAPI_, | ||
| ] | ||
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,5 @@ | ||
| _build/* | ||
|
|
||
| **/CxClass.* | ||
| test/old_tests/Component/Component_h.h | ||
| test/old_tests/Composable/Composable_h.h |
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,106 @@ | ||
| # editorconfig: http://editorconfig.org/ | ||
| # Help developers standardize spaces, tabs, encoding, end-line characters across editors | ||
|
|
||
| # top-most .editorconfig file | ||
| root = true | ||
|
|
||
| # defaults for all files | ||
| [*] | ||
| charset = utf-8 | ||
| end_of_line = lf | ||
| tab_width = 4 | ||
| indent_size = 4 | ||
| indent_style = space | ||
| insert_final_newline = true | ||
| trim_trailing_whitespace = true | ||
|
|
||
| # markdown, diff overrides | ||
| # two trailing spaces are required for <br/> and hard line-breaks in markdown files | ||
| # see: (https://daringfireball.net/projects/markdown/syntax#p) and (http://spec.commonmark.org/0.27/#hard-line-break) | ||
| [*.{md,diff}] | ||
| trim_trailing_whitespace = false | ||
|
|
||
| [*.{md,xml,xsd,gprops,man,natvis}] | ||
| indent_size = 2 | ||
|
|
||
| # XML-based MSBuild and Visual Studio files | ||
| [*.{props,targets,settings,*proj,vcxitems,filters,ruleset,config,nuspec,resx,vsixmanifest,vsct}] | ||
| indent_size = 2 | ||
|
|
||
| # Exceptions to the above *proj wildcard | ||
| [*.vdproj] | ||
| indent_size = 4 | ||
|
|
||
| # Visual Studio uses hard tabs for SLN files, so don't fight it | ||
| [*.sln] | ||
| indent_style = tab | ||
|
|
||
| # Visual Studio removes the last empty line, so don't fight it | ||
| [*.{vcxproj}] | ||
| insert_final_newline = false | ||
|
|
||
| # YAML overrides | ||
| [*.{yml,yaml}] | ||
| indent_size = 2 | ||
|
|
||
| [*.{cpp,h,idl}] | ||
| trim_trailing_whitespace = true | ||
| insert_final_newline = true | ||
| cpp_indent_braces=false | ||
| cpp_indent_multi_line_relative_to=innermost_parenthesis | ||
| cpp_indent_within_parentheses=indent | ||
| cpp_indent_preserve_within_parentheses=false | ||
| cpp_indent_case_contents=true | ||
| cpp_indent_case_labels=false | ||
| cpp_indent_case_contents_when_block=false | ||
| cpp_indent_lambda_braces_when_parameter=true | ||
| cpp_indent_goto_labels=one_left | ||
| cpp_indent_preprocessor=leftmost_column | ||
| cpp_indent_access_specifiers=false | ||
| cpp_indent_namespace_contents=true | ||
| cpp_indent_preserve_comments=false | ||
| cpp_new_line_before_open_brace_namespace=ignore | ||
| cpp_new_line_before_open_brace_type=ignore | ||
| cpp_new_line_before_open_brace_function=ignore | ||
| cpp_new_line_before_open_brace_block=ignore | ||
| cpp_new_line_before_open_brace_lambda=ignore | ||
| cpp_new_line_scope_braces_on_separate_lines=false | ||
| cpp_new_line_close_brace_same_line_empty_type=false | ||
| cpp_new_line_close_brace_same_line_empty_function=false | ||
| cpp_new_line_before_catch=true | ||
| cpp_new_line_before_else=true | ||
| cpp_new_line_before_while_in_do_while=false | ||
| cpp_space_before_function_open_parenthesis=remove | ||
| cpp_space_within_parameter_list_parentheses=false | ||
| cpp_space_between_empty_parameter_list_parentheses=false | ||
| cpp_space_after_keywords_in_control_flow_statements=true | ||
| cpp_space_within_control_flow_statement_parentheses=false | ||
| cpp_space_before_lambda_open_parenthesis=false | ||
| cpp_space_within_cast_parentheses=false | ||
| cpp_space_after_cast_close_parenthesis=false | ||
| cpp_space_within_expression_parentheses=false | ||
| cpp_space_before_block_open_brace=true | ||
| cpp_space_between_empty_braces=false | ||
| cpp_space_before_initializer_list_open_brace=false | ||
| cpp_space_within_initializer_list_braces=true | ||
| cpp_space_preserve_in_initializer_list=true | ||
| cpp_space_before_open_square_bracket=false | ||
| cpp_space_within_square_brackets=false | ||
| cpp_space_before_empty_square_brackets=false | ||
| cpp_space_between_empty_square_brackets=false | ||
| cpp_space_group_square_brackets=true | ||
| cpp_space_within_lambda_brackets=false | ||
| cpp_space_between_empty_lambda_brackets=false | ||
| cpp_space_before_comma=false | ||
| cpp_space_after_comma=true | ||
| cpp_space_remove_around_member_operators=true | ||
| cpp_space_before_inheritance_colon=true | ||
| cpp_space_before_constructor_colon=true | ||
| cpp_space_remove_before_semicolon=true | ||
| cpp_space_after_semicolon=false | ||
| cpp_space_remove_around_unary_operator=true | ||
| cpp_space_around_binary_operator=insert | ||
| cpp_space_around_assignment_operator=insert | ||
| cpp_space_pointer_reference_alignment=left | ||
| cpp_space_around_ternary_operator=insert | ||
| cpp_wrap_preserve_blocks=one_liners |
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
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.
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.