Skip to content

Commit 9202b86

Browse files
committed
Update Development Tools & Documentation
1 parent be3e6a2 commit 9202b86

File tree

356 files changed

+11313
-6747
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

356 files changed

+11313
-6747
lines changed

.clang-format

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,78 @@
1+
# QGroundControl C++ Code Formatting
2+
# Based on Google style with QGC customizations
3+
# Matches CodingStyle.cc/h patterns
4+
15
BasedOnStyle: Google
6+
Language: Cpp
7+
8+
# Line length and indentation
29
ColumnLimit: 120
310
IndentWidth: 4
11+
TabWidth: 4
12+
UseTab: Never
13+
ContinuationIndentWidth: 4
14+
15+
# Bracing - Allman style (opening brace on new line)
16+
BreakBeforeBraces: Allman
17+
AllowShortFunctionsOnASingleLine: None
18+
AllowShortIfStatementsOnASingleLine: Never
19+
AllowShortLoopsOnASingleLine: false
20+
AllowShortBlocksOnASingleLine: Never
21+
AllowShortCaseLabelsOnASingleLine: false
22+
23+
# Pointer and reference alignment
24+
PointerAlignment: Left
25+
ReferenceAlignment: Left
26+
DerivePointerAlignment: false
27+
28+
# Spacing
29+
SpaceAfterCStyleCast: false
30+
SpaceAfterLogicalNot: false
31+
SpaceBeforeAssignmentOperators: true
32+
SpaceBeforeParens: ControlStatements
33+
SpaceInEmptyParentheses: false
34+
SpacesInAngles: Never
35+
SpacesInCStyleCastParentheses: false
36+
SpacesInParentheses: false
37+
SpacesInSquareBrackets: false
38+
39+
# Include sorting
40+
SortIncludes: CaseSensitive
41+
IncludeBlocks: Regroup
42+
IncludeCategories:
43+
- Regex: '^<Q.*>' # Qt headers
44+
Priority: 1
45+
- Regex: '^<.*>' # System/STL headers
46+
Priority: 2
47+
- Regex: '.*' # Project headers
48+
Priority: 3
49+
50+
# Alignment
51+
AlignAfterOpenBracket: Align
52+
AlignConsecutiveAssignments: None
53+
AlignConsecutiveDeclarations: None
54+
AlignOperands: Align
55+
AlignTrailingComments:
56+
Kind: Always
57+
OverEmptyLines: 1
58+
59+
# Line breaks
60+
AlwaysBreakAfterReturnType: None
61+
AlwaysBreakTemplateDeclarations: Yes
62+
BreakBeforeBinaryOperators: None
63+
BreakBeforeTernaryOperators: true
64+
BreakConstructorInitializers: BeforeColon
65+
BreakInheritanceList: BeforeColon
66+
ConstructorInitializerIndentWidth: 4
67+
68+
# Namespace formatting
69+
CompactNamespaces: false
70+
NamespaceIndentation: None
71+
72+
# Other formatting
73+
BinPackArguments: true
74+
BinPackParameters: true
75+
KeepEmptyLinesAtTheStartOfBlocks: false
76+
MaxEmptyLinesToKeep: 1
77+
ReflowComments: true
78+
Standard: c++20

.clang-tidy

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,66 @@
1+
# QGroundControl C++ Static Analysis
2+
# Clang-Tidy configuration for C++20 and Qt 6
3+
14
---
25
Checks: >
3-
clang-analyzer-*,
4-
WarningsAsErrors: '*'
6+
-*,
7+
bugprone-*,
8+
-bugprone-easily-swappable-parameters,
9+
-bugprone-exception-escape,
10+
clang-analyzer-*,
11+
-clang-analyzer-cplusplus.NewDeleteLeaks,
12+
modernize-*,
13+
-modernize-use-trailing-return-type,
14+
-modernize-avoid-c-arrays,
15+
performance-*,
16+
readability-*,
17+
-readability-magic-numbers,
18+
-readability-identifier-length,
19+
-readability-function-cognitive-complexity,
20+
cppcoreguidelines-*,
21+
-cppcoreguidelines-avoid-magic-numbers,
22+
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
23+
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
24+
-cppcoreguidelines-pro-type-vararg,
25+
-cppcoreguidelines-avoid-const-or-ref-data-members,
26+
27+
WarningsAsErrors: '' # Don't treat warnings as errors by default
28+
29+
CheckOptions:
30+
# Naming conventions (match QGC style)
31+
- key: readability-identifier-naming.ClassCase
32+
value: CamelCase
33+
- key: readability-identifier-naming.StructCase
34+
value: CamelCase
35+
- key: readability-identifier-naming.EnumCase
36+
value: CamelCase
37+
- key: readability-identifier-naming.FunctionCase
38+
value: camelBack
39+
- key: readability-identifier-naming.VariableCase
40+
value: camelBack
41+
- key: readability-identifier-naming.PrivateMemberPrefix
42+
value: '_'
43+
- key: readability-identifier-naming.ProtectedMemberPrefix
44+
value: '_'
45+
- key: readability-identifier-naming.ConstexprVariableCase
46+
value: CamelCase
47+
48+
# Modernization options
49+
- key: modernize-use-nullptr.NullMacros
50+
value: 'NULL'
51+
- key: modernize-loop-convert.MinConfidence
52+
value: 'reasonable'
53+
54+
# Performance options
55+
- key: performance-for-range-copy.WarnOnAllAutoCopies
56+
value: 'true'
57+
- key: performance-move-const-arg.CheckTriviallyCopyableMove
58+
value: 'true'
59+
60+
# Readability options
61+
- key: readability-braces-around-statements.ShortStatementLines
62+
value: '0' # Always require braces
63+
64+
HeaderFilterRegex: '.*'
65+
FormatStyle: file
566
...

.clangd

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,32 @@
1+
# QGroundControl Clangd Configuration
2+
# Language server for C++ code completion and navigation
3+
4+
CompileFlags:
5+
Add:
6+
- "-std=c++20"
7+
- "-Wall"
8+
- "-Wextra"
9+
Remove:
10+
- "-m*" # Remove machine-specific flags
11+
112
Diagnostics:
13+
# Qt macros and moc generate code that triggers false positives
214
UnusedIncludes: None
315
MissingIncludes: None
16+
# Suppress common Qt-related warnings
17+
Suppress:
18+
- "unknown_typename"
19+
- "expansion_to_defined"
20+
21+
Index:
22+
Background: Build
23+
StandardLibrary: Yes
24+
25+
InlayHints:
26+
Enabled: Yes
27+
ParameterNames: Yes
28+
DeducedTypes: Yes
29+
Designators: Yes
30+
31+
Hover:
32+
ShowAKA: Yes

.cmake-format

Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
1+
# QGroundControl CMake Formatting Configuration
2+
# Used by cmake-format for consistent CMake file formatting
3+
# Install: pip install cmake-format
4+
15
format:
2-
line_width: 120
3-
tab_size: 4
4-
max_prefix_chars: 40
5-
use_tabchars: false
6+
line_width: 120
7+
tab_size: 4
8+
max_prefix_chars: 40
9+
use_tabchars: false
10+
dangle_parens: true
11+
dangle_align: prefix
12+
max_subgroups_hwrap: 2
13+
max_pargs_hwrap: 6
14+
separate_ctrl_name_with_space: false
15+
separate_fn_name_with_space: false
16+
command_case: canonical
617

718
parse:
819
additional_commands:
20+
# CPM Package Manager commands
921
cpmaddpackage:
1022
pargs:
1123
nargs: '*'
@@ -41,3 +53,40 @@ parse:
4153
flags: []
4254
spelling: CPMFindPackage
4355
kwargs: *cpmaddpackagekwargs
56+
57+
# Qt macros
58+
qt_add_qml_module:
59+
pargs:
60+
nargs: '1+'
61+
kwargs:
62+
URI: 1
63+
VERSION: 1
64+
QML_FILES: +
65+
SOURCES: +
66+
RESOURCES: +
67+
OUTPUT_DIRECTORY: 1
68+
RESOURCE_PREFIX: 1
69+
70+
qt_add_resources:
71+
pargs:
72+
nargs: '2+'
73+
kwargs:
74+
PREFIX: 1
75+
FILES: +
76+
77+
markup:
78+
enable_markup: false
79+
80+
lint:
81+
disabled_codes: []
82+
function_pattern: '[0-9a-z_]+'
83+
macro_pattern: '[0-9A-Z_]+'
84+
global_var_pattern: '[A-Z][0-9A-Z_]+'
85+
internal_var_pattern: '_[A-Z][0-9A-Z_]+'
86+
local_var_pattern: '[a-z][a-z0-9_]+'
87+
private_var_pattern: '_[0-9a-z_]+'
88+
public_var_pattern: '[A-Z][0-9A-Z_]+'
89+
keyword_pattern: '[A-Z][0-9A-Z_]+'
90+
max_conditionals_custom_parser: 2
91+
min_statement_spacing: 1
92+
max_statement_spacing: 2

.editorconfig

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,64 @@
1+
# QGroundControl EditorConfig
2+
# https://editorconfig.org/
3+
14
root = true
25

6+
# Default settings for all files
37
[*]
48
charset = utf-8
59
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
end_of_line = lf
12+
13+
# C++ source files
14+
[*.{cc,h,cpp,hpp,cxx}]
15+
indent_style = space
16+
indent_size = 4
17+
max_line_length = 120
18+
19+
# CMake files
20+
[{CMakeLists.txt,*.cmake}]
21+
indent_style = space
22+
indent_size = 4
23+
24+
# QML and JavaScript
25+
[*.{qml,js}]
26+
indent_style = space
27+
indent_size = 4
28+
29+
# JSON files
30+
[*.json]
31+
indent_style = space
32+
indent_size = 2
33+
34+
# YAML files
35+
[*.{yml,yaml}]
36+
indent_style = space
37+
indent_size = 2
38+
39+
# Markdown files
40+
[*.md]
41+
indent_style = space
42+
indent_size = 2
43+
trim_trailing_whitespace = false # Preserve trailing spaces for line breaks
44+
45+
# XML files (including Qt resource files)
46+
[*.{xml,qrc,ui}]
47+
indent_style = space
48+
indent_size = 2
49+
50+
# Shell scripts
51+
[*.sh]
52+
indent_style = space
53+
indent_size = 2
54+
end_of_line = lf
55+
56+
# Python scripts
57+
[*.py]
658
indent_style = space
759
indent_size = 4
8-
trim_trailing_whitespace=true
60+
max_line_length = 100
61+
62+
# Makefiles (require tabs)
63+
[{Makefile,*.mk}]
64+
indent_style = tab

.github/CODEOWNERS

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Code Owners for QGroundControl
2+
# These owners will be automatically requested for review when someone opens a pull request.
3+
#
4+
# More info: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
5+
6+
# Default owners for everything in the repo
7+
# * @mavlink/qgroundcontrol-maintainers
8+
9+
# GitHub Actions and CI/CD workflows
10+
# /.github/workflows/ @mavlink/qgroundcontrol-maintainers
11+
# /.github/actions/ @mavlink/qgroundcontrol-maintainers
12+
# .github/dependabot.yml @mavlink/qgroundcontrol-maintainers
13+
14+
# Build system
15+
# /cmake/ @mavlink/qgroundcontrol-maintainers
16+
# CMakeLists.txt @mavlink/qgroundcontrol-maintainers
17+
# /custom/ @mavlink/qgroundcontrol-maintainers
18+
19+
# Core architecture - requires careful review
20+
# /src/FactSystem/ @mavlink/qgroundcontrol-maintainers
21+
# /src/Vehicle/ @mavlink/qgroundcontrol-maintainers
22+
# /src/FirmwarePlugin/ @mavlink/qgroundcontrol-maintainers
23+
# /src/AutoPilotPlugins/ @mavlink/qgroundcontrol-maintainers
24+
25+
# MAVLink protocol handling
26+
# /src/MAVLink/ @mavlink/qgroundcontrol-maintainers
27+
# /src/Comms/ @mavlink/qgroundcontrol-maintainers
28+
29+
# Documentation
30+
# /docs/ @mavlink/qgroundcontrol-maintainers
31+
# *.md @mavlink/qgroundcontrol-maintainers
32+
33+
# Security-sensitive files
34+
# .github/SECURITY.md @mavlink/qgroundcontrol-maintainers

0 commit comments

Comments
 (0)