# SPDX-FileCopyrightText: none
# SPDX-License-Identifier: CC0-1.0
BasedOnStyle:  WebKit
Language:        Cpp
AlignAfterOpenBracket: true
AlwaysBreakTemplateDeclarations: true
AllowShortFunctionsOnASingleLine: Inline
# Note(jzarl): apparently, on clang-format 6.x "BreakBeforeBraces: Linux" behaves as if BraceWrapping.AfterClass was set to false)
BreakBeforeBraces: Linux
ColumnLimit: 0
CommentPragmas:  '^ (FALLTHROUGH|krazy:) '
Standard:        Cpp11
IndentWidth:     4
TabWidth:        4
UseTab:          Never
PointerAlignment: Right
SpacesInParentheses: false
SpacesInAngles:  false
SpacesInCStyleCastParentheses: false
SpaceAfterControlStatementKeyword: true
SpaceBeforeAssignmentOperators: true
# Note(jzarl): SpaceBeforeCpp11BracedList was apparently introduced in 7.0.0 (and set by default in style Webkit)
# TODO: decide whether we set this to false, or if we require clang-format >= 7.0.0 for devs
# SpaceBeforeCpp11BracedList: true
ContinuationIndentWidth: 4
SortIncludes: true

# IncludeBlocks:
#  I'd like to set this to "Regroup", but that leads some false-positives in the commit-hook.
#  See: https://bugs.llvm.org/show_bug.cgi?id=39327
IncludeBlocks: Preserve
IncludeCategories:
# include order:
# 1. "config-kpa-xxx.h"
# 2. "MAIN_HEADER.h"
# 3. KPA-includes
# 4. other includes
  - Regex:           '^<(DB|Utilities|ThumbnailView|AnnotationDialog|BackgroundJobs|BackgroundTaskManager|Browser|CategoryListView|DateBar|Exif|HTMLGenerator|ImageManager|ImportExport|MainWindow|MainWindow/DuplicateMerger|Plugins|Settings|Viewer|XMLDB)/'
    Priority:        2
  - Regex:           '^(</)'
    Priority:        3
  - Regex:           '^"config-kpa'
    Priority:        -1
  - Regex:           '^"'
    Priority:        1
