2017-12-19 15:41:47 +03:00
|
|
|
#
|
|
|
|
# clang-format control file for the FLTK project.
|
|
|
|
#
|
2020-08-22 14:35:42 +03:00
|
|
|
# Copyright 2017-2020 by Bill Spitzak and others.
|
2017-12-19 15:41:47 +03:00
|
|
|
#
|
|
|
|
# This library is free software. Distribution and use rights are outlined in
|
|
|
|
# the file "COPYING" which should have been included with this file. If this
|
|
|
|
# file is missing or damaged, see the license at:
|
|
|
|
#
|
2020-07-01 19:03:10 +03:00
|
|
|
# https://www.fltk.org/COPYING.php
|
2017-12-19 15:41:47 +03:00
|
|
|
#
|
2020-07-01 19:03:10 +03:00
|
|
|
# Please see the following page on how to report bugs and issues:
|
2017-12-19 15:41:47 +03:00
|
|
|
#
|
2020-07-01 19:03:10 +03:00
|
|
|
# https://www.fltk.org/bugs.php
|
2017-12-19 15:41:47 +03:00
|
|
|
#
|
|
|
|
#
|
2017-12-19 16:26:38 +03:00
|
|
|
# Important notes:
|
2017-12-19 15:41:47 +03:00
|
|
|
#
|
2017-12-19 16:26:38 +03:00
|
|
|
# This is a preliminary, experimental version of a clang-format control file.
|
|
|
|
# To use all options including embedded comments to switch formatting
|
|
|
|
# temporarily off and on in source files (see below) clang-format 3.6
|
|
|
|
# or later is required.
|
2017-12-19 15:41:47 +03:00
|
|
|
#
|
2017-12-19 16:26:38 +03:00
|
|
|
# DO NOT USE WITHOUT CHECKING THE RESULT OF FORMATTING FOR CORRECTNESS
|
|
|
|
# AND COMPATIBILITY WITH THE FLTK CMP!
|
2017-12-19 15:41:47 +03:00
|
|
|
#
|
2017-12-19 16:26:38 +03:00
|
|
|
# For more information about clang-format please refer to the online docs at:
|
|
|
|
# http://clang.llvm.org/docs/ClangFormat.html
|
|
|
|
# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
|
2017-12-19 15:41:47 +03:00
|
|
|
#
|
2017-12-19 16:26:38 +03:00
|
|
|
# Embedded comments ("clang-format pragma's") in the source code:
|
|
|
|
# // clang-format off
|
|
|
|
# // clang-format on
|
|
|
|
# /* clang-format off */
|
|
|
|
# /* clang-format on */
|
|
|
|
# can be used to switch clang-format(ting) temporarily off in a source file.
|
|
|
|
# This is particularly useful for embedded pixmaps and other tables
|
|
|
|
# like menu arrays that are pre-formatted for better readability.
|
2017-12-19 15:41:47 +03:00
|
|
|
|
2017-12-19 16:26:38 +03:00
|
|
|
# The options used for FLTK are based on pre-defined style options of LLVM,
|
|
|
|
# which are also the default settings of clang-format.
|
|
|
|
# For a full list of LLVM settings please use
|
|
|
|
# clang-format -style=llvm -dump-config
|
2017-12-19 15:41:47 +03:00
|
|
|
|
2017-12-19 16:26:38 +03:00
|
|
|
# FLTK settings (currently experimental).
|
2017-12-19 15:41:47 +03:00
|
|
|
|
2020-07-01 19:03:10 +03:00
|
|
|
BasedOnStyle: LLVM
|
2017-12-19 15:41:47 +03:00
|
|
|
|
2017-12-19 16:26:38 +03:00
|
|
|
# The Language tag marks C++ options
|
2017-12-19 15:41:47 +03:00
|
|
|
|
2020-07-01 19:03:10 +03:00
|
|
|
# Language: Cpp
|
2017-12-19 15:41:47 +03:00
|
|
|
|
|
|
|
# The following options override the LLVM style definitions, if set.
|
2017-12-19 16:26:38 +03:00
|
|
|
|
|
|
|
# Uncomment one of the following option lines if indenting with tabs
|
|
|
|
# shall be used. Note: tab spacing is still 8 columns, tabs are only
|
|
|
|
# used for indents of 8 columns or more.
|
|
|
|
#
|
|
|
|
# Option "Always" seems to fail counting columns: comments may not be
|
|
|
|
# adjusted as expected (as of clang-format 3.6 and 3.8).
|
|
|
|
# This applies only if "AlignTrailingComments: true" is also set (default).
|
|
|
|
#
|
|
|
|
# UseTab can be set to 'Never' (default) or 'ForIndentation' to avoid
|
|
|
|
# this annoying bug of clang-format.
|
|
|
|
#
|
2020-07-01 19:03:10 +03:00
|
|
|
# UseTab: Always
|
2020-08-22 14:35:42 +03:00
|
|
|
UseTab: Never
|
2017-12-19 15:41:47 +03:00
|
|
|
|
2017-12-19 16:26:38 +03:00
|
|
|
# Should we extend code lines beyond 80 columns ?
|
|
|
|
# Default: 80
|
2020-07-01 19:03:10 +03:00
|
|
|
ColumnLimit: 120
|
2017-12-19 15:41:47 +03:00
|
|
|
|
2017-12-19 16:26:38 +03:00
|
|
|
# The FLTK CMP requires that case labels are indented (LLVM: false)
|
2020-07-01 19:03:10 +03:00
|
|
|
IndentCaseLabels: true
|
2017-12-19 15:41:47 +03:00
|
|
|
|
|
|
|
# There are sometimes more than 1 empty lines; should we keep 2 or more ?
|
2017-12-19 16:26:38 +03:00
|
|
|
# LLVM default is 1.
|
2017-12-19 15:41:47 +03:00
|
|
|
|
2020-07-01 19:03:10 +03:00
|
|
|
MaxEmptyLinesToKeep: 2
|
2017-12-19 15:41:47 +03:00
|
|
|
|
2017-12-19 16:26:38 +03:00
|
|
|
# Present FLTK source code contains some short blocks and if statements
|
2017-12-19 15:41:47 +03:00
|
|
|
# in one line, but we should better make it consistent and NOT use the
|
2017-12-19 16:26:38 +03:00
|
|
|
# following "Allow..." statements (leave them commented out):
|
|
|
|
#
|
|
|
|
# LLVM default values:
|
2020-07-01 19:03:10 +03:00
|
|
|
# AllowShortBlocksOnASingleLine: false
|
|
|
|
# AllowShortFunctionsOnASingleLine: All
|
|
|
|
# AllowShortIfStatementsOnASingleLine: false
|
|
|
|
# AllowShortLoopsOnASingleLine: false
|
2017-12-19 16:26:38 +03:00
|
|
|
#
|
|
|
|
# FLTK values:
|
2020-07-01 19:03:10 +03:00
|
|
|
# AllowShortBlocksOnASingleLine: true
|
|
|
|
# AllowShortIfStatementsOnASingleLine: true
|
2017-12-19 15:41:47 +03:00
|
|
|
|
|
|
|
# Short inline functions in header files are an exception to the above "rule":
|
|
|
|
|
2020-07-01 19:03:10 +03:00
|
|
|
AllowShortFunctionsOnASingleLine: Inline
|
2017-12-19 15:41:47 +03:00
|
|
|
|
2017-12-19 16:26:38 +03:00
|
|
|
# The following is particularly useful for macros with continuation lines.
|
2020-07-01 19:03:10 +03:00
|
|
|
# LLVM default: AlignEscapedNewlinesLeft: false
|
2017-12-19 15:41:47 +03:00
|
|
|
|
2020-07-01 19:03:10 +03:00
|
|
|
AlignEscapedNewlinesLeft: true
|
2017-12-19 15:41:47 +03:00
|
|
|
|
|
|
|
# Include files should be left as-is until we know we can sort them
|
2017-12-19 16:26:38 +03:00
|
|
|
# without any bad side effects (LLVM: true)
|
2017-12-19 15:41:47 +03:00
|
|
|
|
2020-07-01 19:03:10 +03:00
|
|
|
SortIncludes: false
|
2017-12-19 15:41:47 +03:00
|
|
|
|
|
|
|
# Multiple constructor initializers must be on consecutive lines:
|
|
|
|
|
2020-07-01 19:03:10 +03:00
|
|
|
BreakConstructorInitializersBeforeComma: true
|
2017-12-19 15:41:47 +03:00
|
|
|
|
2017-12-19 16:26:38 +03:00
|
|
|
# Constructor initializers will be indented by 2 spaces (LLVM: 4):
|
2017-12-19 15:41:47 +03:00
|
|
|
|
2020-07-01 19:03:10 +03:00
|
|
|
ConstructorInitializerIndentWidth: 2
|
2017-12-19 15:41:47 +03:00
|
|
|
|
2017-12-19 16:26:38 +03:00
|
|
|
# Continuation lines (if automatically wrapped) may be indented differently.
|
|
|
|
# This does not apply to function call arguments which are aligned to the
|
|
|
|
# opening bracket. LLVM (default): 4
|
2020-07-01 19:03:10 +03:00
|
|
|
# ContinuationIndentWidth: 2
|
2017-12-19 15:41:47 +03:00
|
|
|
|
2017-12-19 16:26:38 +03:00
|
|
|
# Most of FLTK's code uses 'void *p' as opposed to 'void* p'.
|
|
|
|
# This is particularly useful in combined declarations like:
|
|
|
|
# int var, var2, *pv, **pp;
|
|
|
|
# Note: clang-format uses "Right" in such combined declarations anyway,
|
|
|
|
# so to be consistent the best setting appears to be "Right".
|
|
|
|
# clang-format can try to derive the setting from code in the file, but this
|
|
|
|
# is error-prone and can lead to inconsistent settings in different files.
|
|
|
|
# Note: this also applies to references like 'int &w, int &h', for instance
|
|
|
|
# in function parameter lists.
|
|
|
|
|
2020-07-01 19:03:10 +03:00
|
|
|
DerivePointerAlignment: false
|
|
|
|
PointerAlignment: Right
|