Skip to content

Instantly share code, notes, and snippets.

@changx03
Created May 7, 2024 06:17
Show Gist options
  • Save changx03/e5d0742cb2746801c834748cf8e602ba to your computer and use it in GitHub Desktop.
Save changx03/e5d0742cb2746801c834748cf8e602ba to your computer and use it in GitHub Desktop.
Clang-Format for QGroundControl
# Based on Google style
BasedOnStyle: Google
# Set a large limit to avoid line wrapping
ColumnLimit: 0
# Keep include order and style
IncludeBlocks: Preserve
SortIncludes: false
# Enforce one initializer per line in constructor
ConstructorInitializerAllOnOneLineOrOnePerLine: true
# Control indentation and alignment
AlignConsecutiveAssignments: true
AlignOperands: true
AlignConsecutiveDeclarations:
Enabled: true
AcrossEmptyLines: false
AcrossComments: false
# Indent and formatting control
AccessModifierOffset: -2
IndentWidth: 4
TabWidth: 4
UseTab: Never
# Empty line after function definitions
SeparateDefinitionBlocks: Always
# Indentation of function declarations/definitions
AlignAfterOpenBracket: Align
PenaltyBreakBeforeFirstCallParameter: 0
# Control brace usage for functions and blocks
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
AfterControlStatement: false
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: false
BeforeElse: false
IndentBraces: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment