rsyslog/.clang-format
Rainer Gerhards 786ea7c92f
chore: add project-wide formatting and editor configs
- 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.
2025-07-16 17:08:01 +02:00

44 lines
1.3 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Base on Googles 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 rsyslogs 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
# Dont 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 arent 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