Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
75 changes: 75 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,3 +1,78 @@
# QGroundControl C++ Code Formatting
# Based on Google style with QGC customizations
# Matches CodingStyle.cc/h patterns

BasedOnStyle: Google
Language: Cpp

# Line length and indentation
ColumnLimit: 120
IndentWidth: 4
TabWidth: 4
UseTab: Never
ContinuationIndentWidth: 4

# Bracing - Allman style (opening brace on new line)
BreakBeforeBraces: Allman
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false

# Pointer and reference alignment
PointerAlignment: Left
ReferenceAlignment: Left
DerivePointerAlignment: false

# Spacing
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesInAngles: Never
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false

# Include sorting
SortIncludes: CaseSensitive
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^<Q.*>' # Qt headers
Priority: 1
- Regex: '^<.*>' # System/STL headers
Priority: 2
- Regex: '.*' # Project headers
Priority: 3

# Alignment
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: None
AlignConsecutiveDeclarations: None
AlignOperands: Align
AlignTrailingComments:
Kind: Always
OverEmptyLines: 1

# Line breaks
AlwaysBreakAfterReturnType: None
AlwaysBreakTemplateDeclarations: Yes
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
ConstructorInitializerIndentWidth: 4

# Namespace formatting
CompactNamespaces: false
NamespaceIndentation: None

# Other formatting
BinPackArguments: true
BinPackParameters: true
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
ReflowComments: true
Standard: c++20
65 changes: 63 additions & 2 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,5 +1,66 @@
# QGroundControl C++ Static Analysis
# Clang-Tidy configuration for C++20 and Qt 6

---
Checks: >
clang-analyzer-*,
WarningsAsErrors: '*'
-*,
bugprone-*,
-bugprone-easily-swappable-parameters,
-bugprone-exception-escape,
clang-analyzer-*,
-clang-analyzer-cplusplus.NewDeleteLeaks,
modernize-*,
-modernize-use-trailing-return-type,
-modernize-avoid-c-arrays,
performance-*,
readability-*,
-readability-magic-numbers,
-readability-identifier-length,
-readability-function-cognitive-complexity,
cppcoreguidelines-*,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-avoid-const-or-ref-data-members,

WarningsAsErrors: '' # Don't treat warnings as errors by default

CheckOptions:
# Naming conventions (match QGC style)
- key: readability-identifier-naming.ClassCase
value: CamelCase
- key: readability-identifier-naming.StructCase
value: CamelCase
- key: readability-identifier-naming.EnumCase
value: CamelCase
- key: readability-identifier-naming.FunctionCase
value: camelBack
- key: readability-identifier-naming.VariableCase
value: camelBack
- key: readability-identifier-naming.PrivateMemberPrefix
value: '_'
- key: readability-identifier-naming.ProtectedMemberPrefix
value: '_'
- key: readability-identifier-naming.ConstexprVariableCase
value: CamelCase

# Modernization options
- key: modernize-use-nullptr.NullMacros
value: 'NULL'
- key: modernize-loop-convert.MinConfidence
value: 'reasonable'

# Performance options
- key: performance-for-range-copy.WarnOnAllAutoCopies
value: 'true'
- key: performance-move-const-arg.CheckTriviallyCopyableMove
value: 'true'

# Readability options
- key: readability-braces-around-statements.ShortStatementLines
value: '0' # Always require braces

HeaderFilterRegex: '.*'
FormatStyle: file
...
29 changes: 29 additions & 0 deletions .clangd
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
# QGroundControl Clangd Configuration
# Language server for C++ code completion and navigation

CompileFlags:
Add:
- "-std=c++20"
- "-Wall"
- "-Wextra"
Remove:
- "-m*" # Remove machine-specific flags

Diagnostics:
# Qt macros and moc generate code that triggers false positives
UnusedIncludes: None
MissingIncludes: None
# Suppress common Qt-related warnings
Suppress:
- "unknown_typename"
- "expansion_to_defined"

Index:
Background: Build
StandardLibrary: Yes

InlayHints:
Enabled: Yes
ParameterNames: Yes
DeducedTypes: Yes
Designators: Yes

Hover:
ShowAKA: Yes
57 changes: 53 additions & 4 deletions .cmake-format
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
# QGroundControl CMake Formatting Configuration
# Used by cmake-format for consistent CMake file formatting
# Install: pip install cmake-format

format:
line_width: 120
tab_size: 4
max_prefix_chars: 40
use_tabchars: false
line_width: 120
tab_size: 4
max_prefix_chars: 40
use_tabchars: false
dangle_parens: true
dangle_align: prefix
max_subgroups_hwrap: 2
max_pargs_hwrap: 6
separate_ctrl_name_with_space: false
separate_fn_name_with_space: false
command_case: canonical

parse:
additional_commands:
# CPM Package Manager commands
cpmaddpackage:
pargs:
nargs: '*'
Expand Down Expand Up @@ -41,3 +53,40 @@ parse:
flags: []
spelling: CPMFindPackage
kwargs: *cpmaddpackagekwargs

# Qt macros
qt_add_qml_module:
pargs:
nargs: '1+'
kwargs:
URI: 1
VERSION: 1
QML_FILES: +
SOURCES: +
RESOURCES: +
OUTPUT_DIRECTORY: 1
RESOURCE_PREFIX: 1

qt_add_resources:
pargs:
nargs: '2+'
kwargs:
PREFIX: 1
FILES: +

markup:
enable_markup: false

lint:
disabled_codes: []
function_pattern: '[0-9a-z_]+'
macro_pattern: '[0-9A-Z_]+'
global_var_pattern: '[A-Z][0-9A-Z_]+'
internal_var_pattern: '_[A-Z][0-9A-Z_]+'
local_var_pattern: '[a-z][a-z0-9_]+'
private_var_pattern: '_[0-9a-z_]+'
public_var_pattern: '[A-Z][0-9A-Z_]+'
keyword_pattern: '[A-Z][0-9A-Z_]+'
max_conditionals_custom_parser: 2
min_statement_spacing: 1
max_statement_spacing: 2
58 changes: 57 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,8 +1,64 @@
# QGroundControl EditorConfig
# https://editorconfig.org/

root = true

# Default settings for all files
[*]
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
end_of_line = lf

# C++ source files
[*.{cc,h,cpp,hpp,cxx}]
indent_style = space
indent_size = 4
max_line_length = 120

# CMake files
[{CMakeLists.txt,*.cmake}]
indent_style = space
indent_size = 4

# QML and JavaScript
[*.{qml,js}]
indent_style = space
indent_size = 4

# JSON files
[*.json]
indent_style = space
indent_size = 2

# YAML files
[*.{yml,yaml}]
indent_style = space
indent_size = 2

# Markdown files
[*.md]
indent_style = space
indent_size = 2
trim_trailing_whitespace = false # Preserve trailing spaces for line breaks

# XML files (including Qt resource files)
[*.{xml,qrc,ui}]
indent_style = space
indent_size = 2

# Shell scripts
[*.sh]
indent_style = space
indent_size = 2
end_of_line = lf

# Python scripts
[*.py]
indent_style = space
indent_size = 4
trim_trailing_whitespace=true
max_line_length = 100

# Makefiles (require tabs)
[{Makefile,*.mk}]
indent_style = tab
34 changes: 34 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Code Owners for QGroundControl
# These owners will be automatically requested for review when someone opens a pull request.
#
# More info: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners

# Default owners for everything in the repo
# * @mavlink/qgroundcontrol-maintainers

# GitHub Actions and CI/CD workflows
# /.github/workflows/ @mavlink/qgroundcontrol-maintainers
# /.github/actions/ @mavlink/qgroundcontrol-maintainers
# .github/dependabot.yml @mavlink/qgroundcontrol-maintainers

# Build system
# /cmake/ @mavlink/qgroundcontrol-maintainers
# CMakeLists.txt @mavlink/qgroundcontrol-maintainers
# /custom/ @mavlink/qgroundcontrol-maintainers

# Core architecture - requires careful review
# /src/FactSystem/ @mavlink/qgroundcontrol-maintainers
# /src/Vehicle/ @mavlink/qgroundcontrol-maintainers
# /src/FirmwarePlugin/ @mavlink/qgroundcontrol-maintainers
# /src/AutoPilotPlugins/ @mavlink/qgroundcontrol-maintainers

# MAVLink protocol handling
# /src/MAVLink/ @mavlink/qgroundcontrol-maintainers
# /src/Comms/ @mavlink/qgroundcontrol-maintainers

# Documentation
# /docs/ @mavlink/qgroundcontrol-maintainers
# *.md @mavlink/qgroundcontrol-maintainers

# Security-sensitive files
# .github/SECURITY.md @mavlink/qgroundcontrol-maintainers
Loading
Loading