mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-13 04:50:41 +01:00
- add .editorconfig for indent, whitespace, and file-type rules - add project-local .vimrc to enforce Vim settings via exrc - add .clang-format for C/C++ style presets and list formatting - add devtools/format-code.sh to run clang-format and fixups - adjust clang-format config for stable, idempotent output - update AGENTS.md with new formatting strategy - add .git-blame-ignore-revs entry for format change commit This commit sets up an automated formatting pipeline to let contributors use their editor of choice while ensuring consistent, stable code style across the project.
44 lines
1.3 KiB
YAML
44 lines
1.3 KiB
YAML
# Base on Google’s K&R-style preset (Attach braces, indent case labels, etc.)
|
||
BasedOnStyle: Google
|
||
|
||
# Switch from tabs to spaces (4 spaces per level)
|
||
IndentWidth: 4
|
||
TabWidth: 4
|
||
UseTab: Never
|
||
|
||
# Ensure pointer stars stay next to the type, as in rsyslog’s declarations
|
||
PointerAlignment: Left
|
||
|
||
# Keep case labels indented under switch
|
||
IndentCaseLabels: true
|
||
|
||
# Continuation lines (e.g. broken calls) also align with 4 spaces
|
||
ContinuationIndentWidth: 4
|
||
|
||
# Pack function parameters onto one line when they fit
|
||
#BinPackParameters: true
|
||
BinPackParameters: false
|
||
BinPackArguments: true
|
||
AlignAfterOpenBracket: Align
|
||
|
||
# Don’t realign or sort existing trailing comments or includes
|
||
AlignTrailingComments: false
|
||
SortIncludes: false
|
||
|
||
# Prevent short functions or blocks being reformatted into a single line
|
||
AllowShortFunctionsOnASingleLine: Empty
|
||
AllowShortBlocksOnASingleLine: false
|
||
|
||
# Turn off automatic re-wrapping so long comment lines aren’t split
|
||
ColumnLimit: 120
|
||
|
||
# Special handling for some generative macros
|
||
MacroBlockBegin: "^BEGIN"
|
||
MacroBlockEnd: "^END"
|
||
|
||
|
||
MaxEmptyLinesToKeep: 2
|
||
# tells clang-format to indent the whole line – # and all – to the current code indent
|
||
IndentPPDirectives: BeforeHash
|
||
AlignEscapedNewlines: Left
|