Skip to content

Commit

Permalink
Add and apply clang-format
Browse files Browse the repository at this point in the history
This project has no standard on coding style,
some files use tab, others space, and new
Merge Requests usually break the current formatting
with this clang-format we can easy this.
  • Loading branch information
dantti committed Sep 4, 2023
1 parent 4999010 commit 59db522
Show file tree
Hide file tree
Showing 123 changed files with 8,135 additions and 8,412 deletions.
93 changes: 93 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# .clang-format for Cutelyst projects 2023-04-18
# Tries to be close to Qt coding style
# but meh for ASql lambdas which LambdaBodyIndentation ins't enough
---
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: 'false'
AlignConsecutiveAssignments: 'true'
AlignConsecutiveDeclarations: 'false'
AllowShortEnumsOnASingleLine: 'true'
AlignEscapedNewlines: DontAlign
AlignOperands: 'true'
AlignTrailingComments: 'true'
AllowAllArgumentsOnNextLine: 'true'
AllowAllParametersOfDeclarationOnNextLine: 'false'
AllowShortBlocksOnASingleLine: 'false'
AllowShortCaseLabelsOnASingleLine: 'false'
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: Inline
AllowShortLoopsOnASingleLine: 'false'
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: 'false'
AlwaysBreakTemplateDeclarations: 'Yes'
BinPackArguments: 'false'
BinPackParameters: 'false'
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: 'true'
AfterClass: 'true'
AfterEnum: 'false'
AfterFunction: true
SplitEmptyFunction: 'true'
SplitEmptyRecord: 'true'
SplitEmptyNamespace: 'true'
BreakBeforeTernaryOperators: 'true'
BreakConstructorInitializers: BeforeComma
BreakInheritanceList: BeforeComma
BreakStringLiterals: 'true'
CompactNamespaces: 'false'
ConstructorInitializerAllOnOneLineOrOnePerLine: 'false'
ConstructorInitializerIndentWidth: '4'
ContinuationIndentWidth: '4'
ColumnLimit: 100
Cpp11BracedListStyle: 'true'
FixNamespaceComments: 'true'
ForEachMacros:
- forever # avoids { wrapped to next line
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeCategories:
- Regex: '^<Q.*'
Priority: 200
IncludeBlocks: Regroup
IndentAccessModifiers: 'false'
IndentCaseLabels: 'false'
IndentPPDirectives: AfterHash
IndentWidth: '4'
IndentWrappedFunctionNames: 'true'
KeepEmptyLinesAtTheStartOfBlocks: 'true'
Language: Cpp
LambdaBodyIndentation: OuterScope
NamespaceIndentation: None
PointerAlignment: Right
ReflowComments: 'true'
SortIncludes: 'true'
SortUsingDeclarations: 'false'
SpaceAfterCStyleCast: 'true'
SpaceAfterLogicalNot: 'false'
SpaceAfterTemplateKeyword: 'true'
SpaceBeforeAssignmentOperators: 'true'
SpaceBeforeCpp11BracedList: 'false'
SpaceBeforeCtorInitializerColon: 'true'
SpaceBeforeInheritanceColon: 'true'
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: 'true'
SpaceInEmptyParentheses: 'false'
SpacesInAngles: 'false'
SpacesInCStyleCastParentheses: 'false'
SpacesInContainerLiterals: 'false'
SpacesInParentheses: 'false'
SpacesInSquareBrackets: 'false'
Standard: Cpp11
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
WhitespaceSensitiveMacros:
- C_ATTR
UseTab: Never

...
25 changes: 12 additions & 13 deletions DateTime/main.cpp
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// main.cpp

#include <QtGlobal>
#include <iostream>

#include <QCoreApplication>
#include <QtCore>
#include <QVector>
#include <QDebug>
#include <QVariant>
#include <QDebug>

#include <iostream>
#include <QVector>
#include <QtCore>
#include <QtGlobal>
using namespace std;

#include "xlsxdocument.h"
#include "xlsxchartsheet.h"
#include "xlsxcellrange.h"
#include "xlsxchart.h"
#include "xlsxchartsheet.h"
#include "xlsxdocument.h"
#include "xlsxrichstring.h"
#include "xlsxworkbook.h"
using namespace QXlsx;
Expand All @@ -22,12 +22,11 @@ extern int test(QVector<QVariant> params);

int main(int argc, char *argv[])
{
QCoreApplication app(argc, argv);
QCoreApplication app(argc, argv);

QVector<QVariant> testParams;
int ret = test(testParams);
QVector<QVariant> testParams;
int ret = test(testParams);
// qDebug() << "test return value : " << ret;

return 0;
return 0;
}

Loading

0 comments on commit 59db522

Please sign in to comment.