Skip to content

Instantly share code, notes, and snippets.

@thiago-rezende
Last active July 7, 2024 14:59
Show Gist options
  • Select an option

  • Save thiago-rezende/83d8e43eb035c85b384acbb5341fd482 to your computer and use it in GitHub Desktop.

Select an option

Save thiago-rezende/83d8e43eb035c85b384acbb5341fd482 to your computer and use it in GitHub Desktop.
Simple Clang Format and Tidy
---
BasedOnStyle: Chromium
# column rules
ColumnLimit: 120
# file rules
TabWidth: 2
IndentWidth: 2
LineEnding: LF
InsertNewlineAtEOF: True
# includes rules
SortIncludes: Never
# arguments and parameters rules
BinPackArguments: False
BinPackParameters: False
# spacing rules
SpaceInEmptyBlock: True
SpaceAfterCStyleCast: True
# alignment rules
PointerAlignment: Right
AlignEscapedNewlines: Left
AlignTrailingComments: Always
AlignArrayOfStructures: None
AlignConsecutiveMacros: Consecutive
AlignConsecutiveBitFields: Consecutive
AlignConsecutiveAssignments: Consecutive
# line break rules
BreakBeforeTernaryOperators: True
AlwaysBreakBeforeMultilineStrings: True
# short blocks rules
AllowShortBlocksOnASingleLine: Always
AllowShortIfStatementsOnASingleLine: WithoutElse
# braces rules
InsertBraces: True
---
FormatStyle: Chromium
# checking rules
Checks: "clang-diagnostic-*,clang-analyzer-*,cert-*,performance-*,portability-*,readability-"
# general options
WarningsAsErrors: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment