1
0
mirror of https://github.com/QtExcel/QXlsx.git synced 2025-01-30 05:02:52 +08:00

Add pre-commit so CI integration does auto fixes

This commit is contained in:
Daniel Nicoletti 2023-09-15 10:32:35 -03:00
parent 13b8c85633
commit 7311b8b537
2 changed files with 67 additions and 50 deletions

View File

@ -1,50 +1,51 @@
# .clang-format for Cutelyst projects 2023-04-18 # .clang-format for Cutelyst projects 2023-09-15
# Tries to be close to Qt coding style # Tries to be close to Qt coding style
# but meh for ASql lambdas which LambdaBodyIndentation ins't enough # but meh for ASql lambdas which LambdaBodyIndentation ins't enough
--- ---
Language: Cpp
AccessModifierOffset: -4 AccessModifierOffset: -4
AlignAfterOpenBracket: Align AlignAfterOpenBracket: Align
AlignConsecutiveMacros: 'false' AlignConsecutiveMacros: false
AlignConsecutiveAssignments: 'true' AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: 'false' AlignConsecutiveDeclarations: false
AllowShortEnumsOnASingleLine: 'true' AllowShortEnumsOnASingleLine: true
AlignEscapedNewlines: DontAlign AlignEscapedNewlines: DontAlign
AlignOperands: 'true' AlignOperands: true
AlignTrailingComments: 'true' AlignTrailingComments: true
AllowAllArgumentsOnNextLine: 'true' AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: 'false' AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: 'false' AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: 'false' AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline AllowShortFunctionsOnASingleLine: InlineOnly
AllowShortIfStatementsOnASingleLine: Never AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: Inline AllowShortLambdasOnASingleLine: Inline
AllowShortLoopsOnASingleLine: 'false' AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: 'false' AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: 'Yes' AlwaysBreakTemplateDeclarations: 'Yes'
BinPackArguments: 'false' BinPackArguments: false
BinPackParameters: 'false' BinPackParameters: false
BreakBeforeBinaryOperators: None BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom BreakBeforeBraces: Custom
BraceWrapping: BraceWrapping:
AfterCaseLabel: 'true' AfterCaseLabel: true
AfterClass: 'true' AfterClass: true
AfterEnum: 'false' AfterEnum: false
AfterFunction: true AfterFunction: true
SplitEmptyFunction: 'true' SplitEmptyFunction: true
SplitEmptyRecord: 'true' SplitEmptyRecord: true
SplitEmptyNamespace: 'true' SplitEmptyNamespace: true
BreakBeforeTernaryOperators: 'true' BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeComma BreakConstructorInitializers: BeforeComma
BreakInheritanceList: BeforeComma BreakInheritanceList: BeforeComma
BreakStringLiterals: 'true' BreakStringLiterals: true
CompactNamespaces: 'false' CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: 'false' ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: '4' ConstructorInitializerIndentWidth: '4'
ContinuationIndentWidth: '4' ContinuationIndentWidth: '4'
ColumnLimit: 100 ColumnLimit: 100
Cpp11BracedListStyle: 'true' Cpp11BracedListStyle: true
FixNamespaceComments: 'true' FixNamespaceComments: true
ForEachMacros: ForEachMacros:
- forever # avoids { wrapped to next line - forever # avoids { wrapped to next line
- foreach - foreach
@ -54,34 +55,33 @@ IncludeCategories:
- Regex: '^<Q.*' - Regex: '^<Q.*'
Priority: 200 Priority: 200
IncludeBlocks: Regroup IncludeBlocks: Regroup
IndentAccessModifiers: 'false' IndentAccessModifiers: false
IndentCaseLabels: 'false' IndentCaseLabels: false
IndentPPDirectives: AfterHash IndentPPDirectives: AfterHash
IndentWidth: '4' IndentWidth: '4'
IndentWrappedFunctionNames: 'true' IndentWrappedFunctionNames: true
KeepEmptyLinesAtTheStartOfBlocks: 'true' KeepEmptyLinesAtTheStartOfBlocks: true
Language: Cpp
LambdaBodyIndentation: OuterScope LambdaBodyIndentation: OuterScope
NamespaceIndentation: None NamespaceIndentation: None
PointerAlignment: Right PointerAlignment: Right
ReflowComments: 'true' ReflowComments: true
SortIncludes: 'true' SortIncludes: true
SortUsingDeclarations: 'false' SortUsingDeclarations: false
SpaceAfterCStyleCast: 'true' SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: 'false' SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: 'true' SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: 'true' SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: 'false' SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: 'true' SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: 'true' SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: 'true' SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: 'false' SpaceInEmptyParentheses: false
SpacesInAngles: 'false' SpacesInAngles: false
SpacesInCStyleCastParentheses: 'false' SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: 'false' SpacesInContainerLiterals: false
SpacesInParentheses: 'false' SpacesInParentheses: false
SpacesInSquareBrackets: 'false' SpacesInSquareBrackets: false
Standard: Cpp11 Standard: Cpp11
StatementMacros: StatementMacros:
- Q_UNUSED - Q_UNUSED
@ -90,4 +90,8 @@ WhitespaceSensitiveMacros:
- C_ATTR - C_ATTR
UseTab: Never UseTab: Never
---
Language: Json
BasedOnStyle: llvm
... ...

13
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,13 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
exclude: ^(cmake/)
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v16.0.6
hooks:
- id: clang-format