Skip to content

Commit 4f7fc7f

Browse files
Anonymous ReformatterSteinar H. Gunderson
authored andcommitted
Bug #29588949: UPGRADE TO CLANG-FORMAT 8
Upgrade clang-format settings from 5.0 to 8, and rerun it over the entire code base. The real committer is Steinar H. Gunderson <[email protected]>, but the author has been set to Anonymous Reformatter so that git blame won't show myself as author of all existing code. To ignore whitespace changes caused by this commit, please use git blame -w. For ignoring larger changes, you can run blame on the commit immediately preceding this, as follows: git blame clang-format-8-base^ -- path/to/file.cc Change-Id: Ia6fe3de72ab6e760b678305175204f216185fa89
1 parent 0d77e99 commit 4f7fc7f

File tree

338 files changed

+2157
-2145
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

338 files changed

+2157
-2145
lines changed

.clang-format

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@
2020
# along with this program; if not, write to the Free Software
2121
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2222

23-
# This is the output of clang-format-5.0 --style=google --dump-config,
23+
# This is the output of clang-format-8 --style=google --dump-config,
2424
# except for changes mentioned below. We lock the style so that any newer
2525
# version of clang-format will give the same result; as time goes, we may
2626
# update this list, requiring newer versions of clang-format.
2727

28+
---
2829
Language: Cpp
2930
# BasedOnStyle: Google
3031
AccessModifierOffset: -1
@@ -43,7 +44,7 @@ AllowShortLoopsOnASingleLine: true
4344
AlwaysBreakAfterDefinitionReturnType: None
4445
AlwaysBreakAfterReturnType: None
4546
AlwaysBreakBeforeMultilineStrings: true
46-
AlwaysBreakTemplateDeclarations: true
47+
AlwaysBreakTemplateDeclarations: Yes
4748
BinPackArguments: true
4849
BinPackParameters: true
4950
BraceWrapping:
@@ -55,6 +56,7 @@ BraceWrapping:
5556
AfterObjCDeclaration: false
5657
AfterStruct: false
5758
AfterUnion: false
59+
AfterExternBlock: false
5860
BeforeCatch: false
5961
BeforeElse: false
6062
IndentBraces: false
@@ -64,6 +66,7 @@ BraceWrapping:
6466
BreakBeforeBinaryOperators: None
6567
BreakBeforeBraces: Attach
6668
BreakBeforeInheritanceComma: false
69+
BreakInheritanceList: BeforeColon
6770
BreakBeforeTernaryOperators: true
6871
BreakConstructorInitializersBeforeComma: false
6972
BreakConstructorInitializers: BeforeColon
@@ -83,7 +86,10 @@ ForEachMacros:
8386
- foreach
8487
- Q_FOREACH
8588
- BOOST_FOREACH
89+
IncludeBlocks: Preserve
8690
IncludeCategories:
91+
- Regex: '^<ext/.*\.h>'
92+
Priority: 2
8793
- Regex: '^<.*\.h>'
8894
Priority: 1
8995
- Regex: '^<.*'
@@ -92,6 +98,7 @@ IncludeCategories:
9298
Priority: 3
9399
IncludeIsMainRegex: '([-_](test|unittest))?$'
94100
IndentCaseLabels: true
101+
IndentPPDirectives: None
95102
IndentWidth: 2
96103
IndentWrappedFunctionNames: false
97104
JavaScriptQuotes: Leave
@@ -101,30 +108,67 @@ MacroBlockBegin: ''
101108
MacroBlockEnd: ''
102109
MaxEmptyLinesToKeep: 1
103110
NamespaceIndentation: None
111+
ObjCBinPackProtocolList: Never
104112
ObjCBlockIndentWidth: 2
105113
ObjCSpaceAfterProperty: false
106-
ObjCSpaceBeforeProtocolList: false
114+
ObjCSpaceBeforeProtocolList: true
107115
PenaltyBreakAssignment: 2
108116
PenaltyBreakBeforeFirstCallParameter: 1
109117
PenaltyBreakComment: 300
110118
PenaltyBreakFirstLessLess: 120
111119
PenaltyBreakString: 1000
120+
PenaltyBreakTemplateDeclaration: 10
112121
PenaltyExcessCharacter: 1000000
113122
PenaltyReturnTypeOnItsOwnLine: 200
123+
RawStringFormats:
124+
- Language: Cpp
125+
Delimiters:
126+
- cc
127+
- CC
128+
- cpp
129+
- Cpp
130+
- CPP
131+
- 'c++'
132+
- 'C++'
133+
CanonicalDelimiter: ''
134+
BasedOnStyle: google
135+
- Language: TextProto
136+
Delimiters:
137+
- pb
138+
- PB
139+
- proto
140+
- PROTO
141+
EnclosingFunctions:
142+
- EqualsProto
143+
- EquivToProto
144+
- PARSE_PARTIAL_TEXT_PROTO
145+
- PARSE_TEST_PROTO
146+
- PARSE_TEXT_PROTO
147+
- ParseTextOrDie
148+
- ParseTextProtoOrDie
149+
CanonicalDelimiter: ''
150+
BasedOnStyle: google
114151
ReflowComments: true
115152
SortIncludes: true
116153
SortUsingDeclarations: true
117154
SpaceAfterCStyleCast: false
118155
SpaceAfterTemplateKeyword: true
119156
SpaceBeforeAssignmentOperators: true
157+
SpaceBeforeCpp11BracedList: false
158+
SpaceBeforeCtorInitializerColon: true
159+
SpaceBeforeInheritanceColon: true
120160
SpaceBeforeParens: ControlStatements
161+
SpaceBeforeRangeBasedForLoopColon: true
121162
SpaceInEmptyParentheses: false
122163
SpacesBeforeTrailingComments: 2
123164
SpacesInAngles: false
124165
SpacesInContainerLiterals: true
125166
SpacesInCStyleCastParentheses: false
126167
SpacesInParentheses: false
127168
SpacesInSquareBrackets: false
169+
StatementMacros:
170+
- Q_UNUSED
171+
- QT_REQUIRE_VERSION
128172
TabWidth: 8
129173
UseTab: Never
130174

@@ -133,5 +177,5 @@ UseTab: Never
133177
DerivePointerAlignment: false
134178
PointerAlignment: Right
135179

136-
# MySQL source code is allowed to use C++11 features.
180+
# MySQL source code is allowed to use C++11 (and C++14) features.
137181
Standard: Cpp11

client/base/help_options.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636

3737
using namespace Mysql::Tools::Base::Options;
3838
using Mysql::Tools::Base::Abstract_program;
39-
using std::placeholders::_1;
4039
using std::string;
40+
using std::placeholders::_1;
4141

4242
extern const char *load_default_groups[];
4343

client/base/mysql_connection_options.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@
3939
using Mysql::Nullable;
4040
using Mysql::Tools::Base::Abstract_program;
4141
using namespace Mysql::Tools::Base::Options;
42-
using std::placeholders::_1;
4342
using std::string;
4443
using std::vector;
44+
using std::placeholders::_1;
4545

4646
bool Mysql_connection_options::mysql_inited;
4747

client/base/mysql_query_runner.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
#include "template_utils.h"
3535

3636
using namespace Mysql::Tools::Base;
37-
using std::placeholders::_1;
3837
using std::string;
3938
using std::vector;
39+
using std::placeholders::_1;
4040

4141
Mysql_query_runner::Mysql_query_runner(MYSQL *connection)
4242
: m_is_processing(new std::atomic<bool>(false)),

client/base/password_option.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131

3232
using namespace Mysql::Tools::Base::Options;
3333
using Mysql::Nullable;
34-
using std::placeholders::_1;
3534
using std::string;
35+
using std::placeholders::_1;
3636

3737
Password_option::Password_option(Nullable<string> *value, string name,
3838
string description)

client/base/show_variable_query_extractor.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
#include <functional>
2828

2929
using namespace Mysql::Tools::Base;
30-
using std::placeholders::_1;
3130
using std::string;
3231
using std::vector;
32+
using std::placeholders::_1;
3333

3434
Show_variable_query_extractor::Show_variable_query_extractor()
3535
: m_exists(false) {}

client/dump/mysql_object_reader_options.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class Mysql_object_reader_options
4646
uint64 m_row_group_size;
4747
const Mysql_chain_element_options *m_mysql_chain_element_options;
4848
};
49-
}
49+
} // namespace Dump
5050
} // namespace Tools
5151
} // namespace Mysql
5252

client/mysql.cc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2574,9 +2574,9 @@ static bool add_line(String &buffer, char *line, size_t line_length,
25742574
DBUG_RETURN(0);
25752575
}
25762576

2577-
/*****************************************************************
2578-
Interface to Readline Completion
2579-
******************************************************************/
2577+
/*****************************************************************
2578+
Interface to Readline Completion
2579+
******************************************************************/
25802580

25812581
#ifdef HAVE_READLINE
25822582

@@ -2838,7 +2838,7 @@ You can turn off this feature to get a quicker startup with -A\n\n");
28382838
DBUG_VOID_RETURN;
28392839
}
28402840

2841-
/* for gnu readline */
2841+
/* for gnu readline */
28422842

28432843
#ifndef HAVE_INDEX
28442844
extern "C" {
@@ -3937,9 +3937,9 @@ static int com_notee(String *buffer MY_ATTRIBUTE((unused)),
39373937
return 0;
39383938
}
39393939

3940-
/*
3941-
Sorry, this command is not available in Windows.
3942-
*/
3940+
/*
3941+
Sorry, this command is not available in Windows.
3942+
*/
39433943

39443944
#ifdef USE_POPEN
39453945
static int com_pager(String *buffer MY_ATTRIBUTE((unused)),
@@ -3987,9 +3987,9 @@ static int com_nopager(String *buffer MY_ATTRIBUTE((unused)),
39873987
}
39883988
#endif
39893989

3990-
/*
3991-
Sorry, you can't send the result to an editor in Win32
3992-
*/
3990+
/*
3991+
Sorry, you can't send the result to an editor in Win32
3992+
*/
39933993

39943994
#ifdef USE_POPEN
39953995
static int com_edit(String *buffer, char *line MY_ATTRIBUTE((unused))) {

client/mysql_config_editor.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -665,11 +665,11 @@ static bool check_and_create_login_file(void) {
665665
goto error;
666666
}
667667

668-
/*
669-
NOTE : MYSQL_TEST_LOGIN_FILE env must be a full path,
670-
where the directory structure must exist. However the
671-
login file will be created if it does not exist.
672-
*/
668+
/*
669+
NOTE : MYSQL_TEST_LOGIN_FILE env must be a full path,
670+
where the directory structure must exist. However the
671+
login file will be created if it does not exist.
672+
*/
673673
#ifdef _WIN32
674674
if (!(getenv("MYSQL_TEST_LOGIN_FILE"))) {
675675
/* Check if 'MySQL' directory is in place. */

client/mysqladmin.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,7 @@ static int execute_commands(MYSQL *mysql, int argc, char **argv) {
10141014
*/
10151015
}
10161016

1017-
/* Warn about password being set in non ssl connection */
1017+
/* Warn about password being set in non ssl connection */
10181018
#if defined(HAVE_OPENSSL)
10191019
{
10201020
uint ssl_mode = 0;

0 commit comments

Comments
 (0)