Skip to content

Commit

Permalink
clang-format: Clean formatting rules
Browse files Browse the repository at this point in the history
- Remove duplicate entry
- Try to use either "google" or default style settings
- Use default column with 80
- Order settings and add more comments

Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed Apr 7, 2021
1 parent 2fa96b7 commit 83cdcd0
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions .clang-format
@@ -1,21 +1,19 @@
BasedOnStyle: Google

# Modifications for Tesseract.

# Only merge empty functions.
AllowShortFunctionsOnASingleLine: Empty
# Do not allow short if statements.
AllowShortIfStatementsOnASingleLine: false
# Enforce always the same pointer alignment.
DerivePointerAlignment: false
IndentPPDirectives: AfterHash

PointerAlignment: Right
# Default style for some settings.

AccessModifierOffset: -2
AllowShortLoopsOnASingleLine: false
# Enforce always the same pointer alignment.
DerivePointerAlignment: false
IncludeBlocks: Preserve
FixNamespaceComments: true
ColumnLimit: 100
IndentWidth: 2
#IndentAccessModifiers: false # not accepted atm
AccessModifierOffset: -2 # set to minus IndentWidth (-IndentWidth)
PointerAlignment: Right
SpacesBeforeTrailingComments: 1
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
BreakConstructorInitializers: BeforeComma
#ConstructorInitializerAllOnOneLineOrOnePerLine: false

3 comments on commit 83cdcd0

@egorpugin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about FixNamespaceComments and BreakConstructorInitializers?

@stweil
Copy link
Contributor Author

@stweil stweil commented on 83cdcd0 Apr 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FixNamespaceComments: true is in google and default style, so no need to set it.

Both styles also use BreakConstructorInitializers: BeforeColon, so use that for Tesseract, too.

@egorpugin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

Please sign in to comment.