Skip to content

Commit

Permalink
add clang format
Browse files Browse the repository at this point in the history
  • Loading branch information
wengxt committed Jul 3, 2022
1 parent 2a51bcd commit f0611c2
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 6 deletions.
58 changes: 58 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -4
ConstructorInitializerIndentWidth: 4
AlignEscapedNewlinesLeft: false
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AlwaysBreakTemplateDeclarations: true
AlwaysBreakBeforeMultilineStrings: false
BreakBeforeBinaryOperators: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BinPackParameters: true
ColumnLimit: 80
ConstructorInitializerAllOnOneLineOrOnePerLine: false
DerivePointerAlignment: false
ExperimentalAutoDetectBinPacking: false
IndentCaseLabels: false
IndentWrappedFunctionNames: false
IndentFunctionDeclarationAfterType: false
MaxEmptyLinesToKeep: 1
KeepEmptyLinesAtTheStartOfBlocks: true
NamespaceIndentation: None
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakString: 1000
PenaltyBreakFirstLessLess: 120
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
SpacesBeforeTrailingComments: 1
Cpp11BracedListStyle: true
Standard: Cpp11
IndentWidth: 4
TabWidth: 4
UseTab: Never
BreakBeforeBraces: Attach
SpacesInParentheses: false
SpacesInAngles: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: true
SpaceBeforeAssignmentOperators: true
ContinuationIndentWidth: 4
CommentPragmas: '^ IWYU pragma:'
ForEachMacros: [ Q_FOREACH, BOOST_FOREACH ]
SpaceBeforeParens: ControlStatements
DisableFormat: false
SortIncludes: true
...

6 changes: 3 additions & 3 deletions src/bamboo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
*/

#include "bamboo.h"
#include <fcntl.h>
#include <optional>
#include <stdexcept>
#include <fcitx-config/iniparser.h>
#include <fcitx-utils/charutils.h>
#include <fcitx-utils/keysymgen.h>
Expand All @@ -22,6 +19,9 @@
#include <fcitx/statusarea.h>
#include <fcitx/userinterface.h>
#include <fcitx/userinterfacemanager.h>
#include <fcntl.h>
#include <optional>
#include <stdexcept>

namespace fcitx {

Expand Down
6 changes: 3 additions & 3 deletions src/bamboo.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
#ifndef _FCITX5_BAMBOO_BAMBOO_H_
#define _FCITX5_BAMBOO_BAMBOO_H_

#include <string>
#include "bamboo-core.h"
#include "bambooconfig.h"
#include <fcitx-config/iniparser.h>
#include <fcitx-utils/i18n.h>
#include <fcitx/action.h>
Expand All @@ -16,8 +17,7 @@
#include <fcitx/inputcontextproperty.h>
#include <fcitx/inputmethodengine.h>
#include <fcitx/instance.h>
#include "bamboo-core.h"
#include "bambooconfig.h"
#include <string>

namespace fcitx {

Expand Down

0 comments on commit f0611c2

Please sign in to comment.