Skip to content
Snippets Groups Projects
  • Niccolò Betto's avatar
    63376c11
    [Format] Update clang-format rules for version 18 · 63376c11
    Niccolò Betto authored
    Some deprecated options have been updated to the corresponding new ones.
    Some missing rules were added to fix inconsistencies in the code formatting:
    * Add new line ad EOF and trim additional ones
    * Trim empty lines at beginning of blocks
    * Allow brace-less single line if/else/for/while statements
    * Align pointer/reference to the type
    63376c11
    History
    [Format] Update clang-format rules for version 18
    Niccolò Betto authored
    Some deprecated options have been updated to the corresponding new ones.
    Some missing rules were added to fix inconsistencies in the code formatting:
    * Add new line ad EOF and trim additional ones
    * Trim empty lines at beginning of blocks
    * Allow brace-less single line if/else/for/while statements
    * Align pointer/reference to the type
.clang-format 595 B
BasedOnStyle: Google

ColumnLimit: 80
IndentWidth: 4
AccessModifierOffset: -4

BreakBeforeBraces: Allman
# Allow braceless single line if/else/for/while statements
RemoveBracesLLVM: true

AlignConsecutiveAssignments: Consecutive
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
PackConstructorInitializers: BinPack
IndentCaseLabels: true

# Empty lines behavior
InsertNewlineAtEOF: true
KeepEmptyLinesAtEOF: true
KeepEmptyLinesAtTheStartOfBlocks: false

# Align pointers/references to the type, not the variable
DerivePointerAlignment: false
PointerAlignment: Left