Skip to content

Commit 813a2bd

Browse files
authored
Clang format (#3867)
- Outline/*.* - PCH/*.* - PHPLint/*.* - PHPRefactoring/*.* - QMakePlugin/*.* - Remoty/*.* - Rust/*.* - SFTP/*.* - SmartCompletion/*.* - SnipWiz/*.* - SpellChecker/*.* - Subversion2/*.* - Tail/*.* - UnitTestCPP/*.* - WordCompletion/*.* - wxcrafter/**.* - wxformbuilder/*.* - ZoomNavigator/*.* Replace `"wx/wxprec.h"` by `<wx/wxprec.h>` Don't format 3rd party code.
1 parent 6122502 commit 813a2bd

File tree

394 files changed

+9223
-7858
lines changed

Some content is hidden

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

394 files changed

+9223
-7858
lines changed

.clang-format

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ DerivePointerAlignment: false
2121
DisableFormat: false
2222
ExperimentalAutoDetectBinPacking: false
2323
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
24+
IncludeCategories:
25+
- Regex: '^<wx/wxprec.h>'
26+
Priority: -1
27+
SortPriority: 0
28+
- Regex: '^".*"'
29+
Priority: 1
30+
SortPriority: 0
31+
- Regex: '^<.*>'
32+
Priority: 2
33+
SortPriority: 0
2434
IndentCaseLabels: false
2535
IndentWidth: 4
2636
IndentWrappedFunctionNames: false

Outline/outline.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,7 @@
5151
//--------------------------------------------
5252

5353
// Define the plugin entry point
54-
CL_PLUGIN_API IPlugin* CreatePlugin(IManager* manager)
55-
{
56-
return new SymbolViewPlugin(manager);
57-
}
54+
CL_PLUGIN_API IPlugin* CreatePlugin(IManager* manager) { return new SymbolViewPlugin(manager); }
5855

5956
CL_PLUGIN_API PluginInfo* GetPluginInfo()
6057
{

PCH/dummy.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,3 @@
2222
//
2323
//////////////////////////////////////////////////////////////////////////////
2424
//////////////////////////////////////////////////////////////////////////////
25-
26-

PCH/precompiled_header_dbg.h

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
//////////////////////////////////////////////////////////////////////////////
2-
//////////////////////////////////////////////////////////////////////////////
3-
//
4-
// copyright : (C) 2008 by Eran Ifrah
5-
// file name : precompiled_header.h
6-
//
7-
// -------------------------------------------------------------------------
8-
// A
9-
// _____ _ _ _ _
10-
// / __ \ | | | | (_) |
11-
// | / \/ ___ __| | ___| | _| |_ ___
12-
// | | / _ \ / _ |/ _ \ | | | __/ _ )
13-
// | \__/\ (_) | (_| | __/ |___| | || __/
14-
// \____/\___/ \__,_|\___\_____/_|\__\___|
15-
//
16-
// F i l e
17-
//
18-
// This program is free software; you can redistribute it and/or modify
19-
// it under the terms of the GNU General Public License as published by
20-
// the Free Software Foundation; either version 2 of the License, or
21-
// (at your option) any later version.
22-
//
23-
//////////////////////////////////////////////////////////////////////////////
24-
//////////////////////////////////////////////////////////////////////////////
1+
//////////////////////////////////////////////////////////////////////////////
2+
//////////////////////////////////////////////////////////////////////////////
3+
//
4+
// copyright : (C) 2008 by Eran Ifrah
5+
// file name : precompiled_header.h
6+
//
7+
// -------------------------------------------------------------------------
8+
// A
9+
// _____ _ _ _ _
10+
// / __ \ | | | | (_) |
11+
// | / \/ ___ __| | ___| | _| |_ ___
12+
// | | / _ \ / _ |/ _ \ | | | __/ _ )
13+
// | \__/\ (_) | (_| | __/ |___| | || __/
14+
// \____/\___/ \__,_|\___\_____/_|\__\___|
15+
//
16+
// F i l e
17+
//
18+
// This program is free software; you can redistribute it and/or modify
19+
// it under the terms of the GNU General Public License as published by
20+
// the Free Software Foundation; either version 2 of the License, or
21+
// (at your option) any later version.
22+
//
23+
//////////////////////////////////////////////////////////////////////////////
24+
//////////////////////////////////////////////////////////////////////////////
2525
#ifndef CODELITE_PRECOMPILED_HEADER_DEBUG_H
2626
#define CODELITE_PRECOMPILED_HEADER_DEBUG_H
27-
28-
#ifdef __cplusplus
27+
28+
#ifdef __cplusplus
2929

3030
// Only include the headers we need here
3131
#include "../CodeLite/MSWPrivate.h"
@@ -84,7 +84,7 @@
8484
#include <wx/wupdlock.h>
8585
#include <wx/wx.h>
8686
#include <wx/xrc/xmlres.h>
87-
#endif // #if wxUSE_GUI
87+
#endif // #if wxUSE_GUI
8888

8989
/////////////////////////////////////////////////////////////////////////////
9090
// Unicode:
@@ -96,36 +96,36 @@
9696
/////////////////////////////////////////////////////////////////////////////
9797

9898
#if defined(__APPLE__) || defined(__CYGWIN__)
99-
#include <ctype.h>
100-
#undef _C /* _CTYPE_C */
101-
#undef _U /* _CTYPE_U */
99+
#include <ctype.h>
100+
#undef _C /* _CTYPE_C */
101+
#undef _U /* _CTYPE_U */
102102
#endif
103103

104104
#ifdef wxUSE_UNICODE
105-
#ifndef _U
106-
#define _U(x) wxString((x),wxConvUTF8)
107-
#endif
108-
#ifndef _UU
109-
#define _UU(x,y) wxString((x),y)
110-
#endif
111-
#ifndef _CC
112-
#define _CC(x,y) (x).mb_str((y))
113-
#endif
105+
#ifndef _U
106+
#define _U(x) wxString((x), wxConvUTF8)
107+
#endif
108+
#ifndef _UU
109+
#define _UU(x, y) wxString((x), y)
110+
#endif
111+
#ifndef _CC
112+
#define _CC(x, y) (x).mb_str((y))
113+
#endif
114114
#else
115-
#ifndef _U
116-
#define _U(x) (x)
117-
#endif
118-
#ifndef _UU
119-
#define _UU(x,y) (x)
120-
#endif
121-
#ifndef _CC
122-
#define _CC(x,y) (x)
123-
#endif
115+
#ifndef _U
116+
#define _U(x) (x)
117+
#endif
118+
#ifndef _UU
119+
#define _UU(x, y) (x)
120+
#endif
121+
#ifndef _CC
122+
#define _CC(x, y) (x)
123+
#endif
124124
#endif
125125

126126
#ifndef _C
127-
#define _C(x) _CC((x),wxConvUTF8)
127+
#define _C(x) _CC((x), wxConvUTF8)
128128
#endif
129-
129+
130130
#endif // __cplusplus
131131
#endif // CODELITE_PRECOMPILED_HEADER_DEBUG_H

PCH/precompiled_header_release.h

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@
2222
//
2323
//////////////////////////////////////////////////////////////////////////////
2424
//////////////////////////////////////////////////////////////////////////////
25-
#ifndef CODELITE_PRECOMPILED_HEADER_RELEASE_H
26-
#define CODELITE_PRECOMPILED_HEADER_RELEASE_H
27-
25+
#ifndef CODELITE_PRECOMPILED_HEADER_RELEASE_H
26+
#define CODELITE_PRECOMPILED_HEADER_RELEASE_H
2827

2928
#ifdef __cplusplus
3029

@@ -96,37 +95,37 @@
9695
// 3. To convert literal strings, use _T()
9796
/////////////////////////////////////////////////////////////////////////////
9897

99-
#if defined(__APPLE__) || defined(__CYGWIN__)
100-
#include <ctype.h>
101-
#undef _C /* _CTYPE_C */
102-
#undef _U /* _CTYPE_U */
98+
#if defined(__APPLE__) || defined(__CYGWIN__)
99+
#include <ctype.h>
100+
#undef _C /* _CTYPE_C */
101+
#undef _U /* _CTYPE_U */
103102
#endif
104103

105104
#ifdef wxUSE_UNICODE
106-
#ifndef _U
107-
#define _U(x) wxString((x),wxConvUTF8)
108-
#endif
109-
#ifndef _UU
110-
#define _UU(x,y) wxString((x),y)
111-
#endif
112-
#ifndef _CC
113-
#define _CC(x,y) (x).mb_str((y))
114-
#endif
105+
#ifndef _U
106+
#define _U(x) wxString((x), wxConvUTF8)
107+
#endif
108+
#ifndef _UU
109+
#define _UU(x, y) wxString((x), y)
110+
#endif
111+
#ifndef _CC
112+
#define _CC(x, y) (x).mb_str((y))
113+
#endif
115114
#else
116-
#ifndef _U
117-
#define _U(x) (x)
118-
#endif
119-
#ifndef _UU
120-
#define _UU(x,y) (x)
121-
#endif
122-
#ifndef _CC
123-
#define _CC(x,y) (x)
124-
#endif
115+
#ifndef _U
116+
#define _U(x) (x)
117+
#endif
118+
#ifndef _UU
119+
#define _UU(x, y) (x)
120+
#endif
121+
#ifndef _CC
122+
#define _CC(x, y) (x)
123+
#endif
125124
#endif
126125

127126
#ifndef _C
128-
#define _C(x) _CC((x),wxConvUTF8)
127+
#define _C(x) _CC((x), wxConvUTF8)
129128
#endif
130129

131130
#endif // __cplusplus
132-
#endif // CODELITE_PRECOMPILED_HEADER_RELEASE_H
131+
#endif // CODELITE_PRECOMPILED_HEADER_RELEASE_H

PCH/precompiled_header_release_32.h

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@
2222
//
2323
//////////////////////////////////////////////////////////////////////////////
2424
//////////////////////////////////////////////////////////////////////////////
25-
#ifndef CODELITE_PRECOMPILED_HEADER_RELEASE_H
26-
#define CODELITE_PRECOMPILED_HEADER_RELEASE_H
27-
25+
#ifndef CODELITE_PRECOMPILED_HEADER_RELEASE_H
26+
#define CODELITE_PRECOMPILED_HEADER_RELEASE_H
2827

2928
#ifdef __cplusplus
3029

@@ -96,37 +95,37 @@
9695
// 3. To convert literal strings, use _T()
9796
/////////////////////////////////////////////////////////////////////////////
9897

99-
#if defined(__APPLE__) || defined(__CYGWIN__)
100-
#include <ctype.h>
101-
#undef _C /* _CTYPE_C */
102-
#undef _U /* _CTYPE_U */
98+
#if defined(__APPLE__) || defined(__CYGWIN__)
99+
#include <ctype.h>
100+
#undef _C /* _CTYPE_C */
101+
#undef _U /* _CTYPE_U */
103102
#endif
104103

105104
#ifdef wxUSE_UNICODE
106-
#ifndef _U
107-
#define _U(x) wxString((x),wxConvUTF8)
108-
#endif
109-
#ifndef _UU
110-
#define _UU(x,y) wxString((x),y)
111-
#endif
112-
#ifndef _CC
113-
#define _CC(x,y) (x).mb_str((y))
114-
#endif
105+
#ifndef _U
106+
#define _U(x) wxString((x), wxConvUTF8)
107+
#endif
108+
#ifndef _UU
109+
#define _UU(x, y) wxString((x), y)
110+
#endif
111+
#ifndef _CC
112+
#define _CC(x, y) (x).mb_str((y))
113+
#endif
115114
#else
116-
#ifndef _U
117-
#define _U(x) (x)
118-
#endif
119-
#ifndef _UU
120-
#define _UU(x,y) (x)
121-
#endif
122-
#ifndef _CC
123-
#define _CC(x,y) (x)
124-
#endif
115+
#ifndef _U
116+
#define _U(x) (x)
117+
#endif
118+
#ifndef _UU
119+
#define _UU(x, y) (x)
120+
#endif
121+
#ifndef _CC
122+
#define _CC(x, y) (x)
123+
#endif
125124
#endif
126125

127126
#ifndef _C
128-
#define _C(x) _CC((x),wxConvUTF8)
127+
#define _C(x) _CC((x), wxConvUTF8)
129128
#endif
130129

131130
#endif // __cplusplus
132-
#endif // CODELITE_PRECOMPILED_HEADER_RELEASE_H
131+
#endif // CODELITE_PRECOMPILED_HEADER_RELEASE_H

PHPLint/lintoptions.cpp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
#include "cl_standard_paths.h"
21
#include "lintoptions.h"
2+
3+
#include "cl_standard_paths.h"
34
#include "fileutils.h"
45
#ifndef __WXMSW__
56
#include "globals.h"
@@ -16,17 +17,19 @@ LintOptions::LintOptions()
1617
{
1718
wxFileName newConfigFile = clStandardPaths::Get().GetUserDataDir() + wxFileName::GetPathSeparator() + "config" +
1819
wxFileName::GetPathSeparator() + "phplint.conf";
19-
if(!newConfigFile.FileExists()) {
20+
if (!newConfigFile.FileExists()) {
2021
wxFileName oldConfigFile = clStandardPaths::Get().GetUserDataDir() + wxFileName::GetPathSeparator() + "config" +
2122
wxFileName::GetPathSeparator() + "php.conf";
2223

2324
// If the file does not exist, create a new one
2425
wxString buf;
25-
if(FileUtils::ReadBufferFromFile(newConfigFile, buf, 1) && (buf == "[")) {
26+
if (FileUtils::ReadBufferFromFile(newConfigFile, buf, 1) && (buf == "[")) {
27+
FileUtils::WriteFileContent(newConfigFile, "{}");
28+
}
29+
30+
if (!newConfigFile.FileExists()) {
2631
FileUtils::WriteFileContent(newConfigFile, "{}");
2732
}
28-
29-
if(!newConfigFile.FileExists()) { FileUtils::WriteFileContent(newConfigFile, "{}"); }
3033

3134
// Save it
3235
JSON newRoot(newConfigFile);
@@ -49,21 +52,21 @@ void LintOptions::FromJSON(const JSONItem& json)
4952

5053
#ifndef __WXMSW__
5154
// Find an installed version of phpcs
52-
if(m_phpcsPhar.IsEmpty()) {
55+
if (m_phpcsPhar.IsEmpty()) {
5356
wxFileName phpcsFile;
5457
::FileUtils::FindExe("phpcs", phpcsFile);
5558
SetPhpcsPhar(phpcsFile);
5659
}
5760

5861
// Find an installed version of phpmd
59-
if(m_phpmdPhar.IsEmpty()) {
62+
if (m_phpmdPhar.IsEmpty()) {
6063
wxFileName phpmdFile;
6164
::FileUtils::FindExe("phpmd", phpmdFile);
6265
SetPhpmdPhar(phpmdFile);
6366
}
6467

6568
// Find an installed version of phpstan
66-
if(m_phpstanPhar.IsEmpty()) {
69+
if (m_phpstanPhar.IsEmpty()) {
6770
wxFileName phpstanFile;
6871
::FileUtils::FindExe("phpstan", phpstanFile);
6972
SetPhpstanPhar(phpstanFile);

0 commit comments

Comments
 (0)