diff --git a/.clang-format b/.clang-format index e1345f284b57..5649307e1055 100644 --- a/.clang-format +++ b/.clang-format @@ -1,17 +1,3 @@ ---- BasedOnStyle: Google -AccessModifierOffset: -4 -AllowShortEnumsOnASingleLine: false -AllowShortFunctionsOnASingleLine: Inline -AllowShortLambdasOnASingleLine: Inline -BinPackArguments: false -BinPackParameters: false ColumnLimit: 120 -IncludeBlocks: Preserve IndentWidth: 4 -Language: Cpp -PackConstructorInitializers: Never -PenaltyBreakAssignment: 80 -SortIncludes: true -SpacesBeforeTrailingComments: 1 -Standard: c++17 diff --git a/.clang-tidy b/.clang-tidy index b9925b48bb88..5e2e27df0e17 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,39 +1,5 @@ --- Checks: > - clang-diagnostic-*, clang-analyzer-*, - bugprone-*, - cppcoreguidelines-*, - google-*, - llvm-*, - misc-*, - modernize-*, - performance-*, - portability-*, - readability-*, - -bugprone-easily-swappable-parameters, - -cppcoreguidelines-avoid-c-arrays, - -cppcoreguidelines-avoid-const-or-ref-data-members, - -cppcoreguidelines-avoid-non-const-global-variables, - -cppcoreguidelines-non-private-member-variables-in-classes, - -cppcoreguidelines-pro-type-reinterpret-cast, - -cppcoreguidelines-pro-type-static-cast-downcast, - -cppcoreguidelines-pro-type-vararg, - -cppcoreguidelines-special-member-functions, - -google-readability-todo, - -llvm-header-guard, - -llvm-include-order, - -misc-include-cleaner, - -misc-no-recursion, - -misc-non-private-member-variables-in-classes, - -misc-use-internal-linkage, - -modernize-avoid-c-arrays, - -modernize-use-trailing-return-type, - -readability-convert-member-functions-to-static, - -readability-function-cognitive-complexity, - -readability-identifier-length, - -readability-redundant-access-specifiers, - -readability-uppercase-literal-suffix WarningsAsErrors: '*' -HeaderFilterRegex: '^((?!vendor).)*$' ... diff --git a/.clangd b/.clangd new file mode 100644 index 000000000000..fa8caec073e9 --- /dev/null +++ b/.clangd @@ -0,0 +1,3 @@ +Diagnostics: + UnusedIncludes: None + MissingIncludes: None diff --git a/.cmake-format b/.cmake-format index ca863a206801..91540173da01 100644 --- a/.cmake-format +++ b/.cmake-format @@ -1,3 +1,4 @@ -format: - tab_size: 4 - line_width: 100 +line_width: 120 +tab_size: 4 +max_prefix_chars: 40 +use_tabchars: false diff --git a/.dockerignore b/.dockerignore index 724cfc15826c..371dcb14d3b9 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,6 +1,7 @@ # Ignore Git repository files .git .gitignore +.gitattributes # Ignore node_modules or other build artifacts node_modules @@ -10,8 +11,5 @@ build Dockerfile* docker-compose.yml -# Ignore OS-specific files -.DS_Store -*.swp - +README.md CMakeLists.txt.user* diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 4122b57d7469..5ace4600a1f2 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,11 +1,6 @@ version: 2 updates: - - package-ecosystem: github-actions - directory: / + - package-ecosystem: "github-actions" + directory: "/" schedule: - interval: daily - groups: - github-actions: - patterns: - - '*' - open-pull-requests-limit: 5 + interval: "weekly" diff --git a/.github/workflows/clang-format-check.yml b/.github/workflows/clang-format-check.yml new file mode 100644 index 000000000000..dbb962b4fa3c --- /dev/null +++ b/.github/workflows/clang-format-check.yml @@ -0,0 +1,18 @@ +name: clang-format Check +on: [workflow_dispatch] +jobs: + formatting-check: + name: Formatting Check + runs-on: ubuntu-latest + strategy: + matrix: + path: + - 'src' + - 'test' + steps: + - uses: actions/checkout@v4 + - name: Run clang-format style check for C++ Source Files. + uses: jidicula/clang-format-action@main + with: + clang-format-version: '17' + check-path: ${{ matrix.path }} diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml new file mode 100644 index 000000000000..c8fa3f9e548b --- /dev/null +++ b/.github/workflows/flatpak.yml @@ -0,0 +1,16 @@ +name: flatpak +on: [workflow_dispatch] +jobs: + flatpak-builder: + name: Flatpak + runs-on: ubuntu-latest + container: + image: bilelmoussaoui/flatpak-github-actions:gnome-47 + options: --privileged + steps: + - uses: actions/checkout@v4 + - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v6 + with: + bundle: org.mavlink.qgroundcontrol.flatpak + manifest-path: ./deploy/flatpak/org.mavlink.qgroundcontrol.yml + cache-key: flatpak-builder-${{ github.sha }} diff --git a/.github/workflows/spelling.yml b/.github/workflows/spelling.yml new file mode 100644 index 000000000000..50220d543d5f --- /dev/null +++ b/.github/workflows/spelling.yml @@ -0,0 +1,11 @@ +name: Typos +on: [workflow_dispatch] +jobs: + typos: + name: Spell Check with Typos + runs-on: ubuntu-latest + steps: + - name: Checkout Actions Repository + uses: actions/checkout@v4 + - name: Check spelling + uses: crate-ci/typos@master diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7ab049cd01d2..47f7a26f76bf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,3 +4,4 @@ repos: hooks: - id: check-yaml args: [--allow-multiple-documents, --unsafe] + - id: check-json diff --git a/CMakeLists.txt b/CMakeLists.txt index 20ca0273dcfe..c88ef2135752 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -481,8 +481,6 @@ elseif(ANDROID) # QT_ANDROID_SDK_BUILD_TOOLS_REVISION # QT_ANDROID_SYSTEM_LIBS_PREFIX ) -elseif(LINUX) - endif() add_compile_definitions( diff --git a/codecov.yml b/codecov.yml index d25776f53383..28eb813be3bf 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,7 +1,10 @@ +codecov: + notify: + require_ci_to_pass: yes + coverage: - round: down - precision: 1 status: project: default: - threshold: 1% + target: 10% + threshold: 5% diff --git a/deploy/android/GooglePlayDailyIcon.png b/deploy/android/GooglePlayDailyIcon.png deleted file mode 100644 index 087667afdbbf..000000000000 Binary files a/deploy/android/GooglePlayDailyIcon.png and /dev/null differ diff --git a/deploy/android/GooglePlayFeatureGraphic.png b/deploy/android/GooglePlayFeatureGraphic.png deleted file mode 100644 index e49b9949cc39..000000000000 Binary files a/deploy/android/GooglePlayFeatureGraphic.png and /dev/null differ diff --git a/deploy/android/GooglePlayScreenShot1.jpg b/deploy/android/GooglePlayScreenShot1.jpg deleted file mode 100755 index 4adfd44fbdd8..000000000000 Binary files a/deploy/android/GooglePlayScreenShot1.jpg and /dev/null differ diff --git a/deploy/android/GooglePlayScreenShot2.jpg b/deploy/android/GooglePlayScreenShot2.jpg deleted file mode 100755 index 04f2ad672e85..000000000000 Binary files a/deploy/android/GooglePlayScreenShot2.jpg and /dev/null differ diff --git a/deploy/android/GooglePlayUpload.py b/deploy/android/GooglePlayUpload.py deleted file mode 100755 index dc61591b8231..000000000000 --- a/deploy/android/GooglePlayUpload.py +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/python -# -# Copyright 2014 Marta Rodriguez. -# -# Licensed under the Apache License, Version 2.0 (the 'License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Uploads an apk to the google play store.""" - -import argparse - -from apiclient.discovery import build -import httplib2 -from oauth2client import client -from oauth2client.service_account import ServiceAccountCredentials - -JSON_KEY='Google_Play_Android_Developer-4432a3c4f5d1.json' - -# Declare command-line flags. -argparser = argparse.ArgumentParser(add_help=False) -argparser.add_argument('package_name', - help='The package name. Example: com.android.sample') - -def main(): - # Create an httplib2.Http object to handle our HTTP requests and authorize it - # with the Credentials. Note that the first parameter, service_account_name, - # is the Email address created for the Service account. It must be the email - # address associated with the key that was created. - credentials = ServiceAccountCredentials.from_json_keyfile_name(JSON_KEY, scopes=['https://www.googleapis.com/auth/androidpublisher']) - - http = httplib2.Http() - http = credentials.authorize(http) - - service = build('androidpublisher', 'v3', http=http) - - # Process flags and read their values. - flags = argparser.parse_args() - - release_track = 'production' - package_name = flags.package_name - - try: - print 'Uploading package %s to track %s' % (package_name, release_track) - edit_request = service.edits().insert(body={}, packageName=package_name) - result = edit_request.execute() - edit_id = result['id'] - - apk_response_32 = service.edits().apks().upload( - editId=edit_id, - packageName=package_name, - media_body='QGroundControl32.apk').execute() - print 'Version code %d has been uploaded' % apk_response_32['versionCode'] - - apk_response_64 = service.edits().apks().upload( - editId=edit_id, - packageName=package_name, - media_body='QGroundControl64.apk').execute() - print 'Version code %d has been uploaded' % apk_response_64['versionCode'] - - track_response = service.edits().tracks().update( - editId=edit_id, - track=release_track, - packageName=package_name, - body={u'releases': [{ - u'versionCodes': [str(apk_response_32['versionCode']), str(apk_response_64['versionCode'])], - u'status': u'completed', - }]}).execute() - - print 'Track %s is set with releases: %s' % ( - track_response['track'], str(track_response['releases'])) - - commit_request = service.edits().commit( - editId=edit_id, packageName=package_name).execute() - - print 'Edit "%s" has been committed' % (commit_request['id']) - - except client.AccessTokenRefreshError: - print ('The credentials have been revoked or expired, please re-run the ' - 'application to re-authorize') - -if __name__ == '__main__': - main() diff --git a/deploy/android/Google_Play_Android_Developer-4432a3c4f5d1.json.enc b/deploy/android/Google_Play_Android_Developer-4432a3c4f5d1.json.enc deleted file mode 100644 index dae400d87ac5..000000000000 Binary files a/deploy/android/Google_Play_Android_Developer-4432a3c4f5d1.json.enc and /dev/null differ diff --git a/deploy/linux/appimagecraft.yml b/deploy/linux/appimagecraft.yml new file mode 100644 index 000000000000..98b29b3f4757 --- /dev/null +++ b/deploy/linux/appimagecraft.yml @@ -0,0 +1,23 @@ +version: 1 + +project: + name: QGroundControl + version: Daily + +build: + cmake: + source_dir: src/ + extra_variables: + - Qt6_ROOT=/home/runner/work/_temp/Qt/6.8.1/gcc_64 + environment: + BUILD_TYPE: Release + +appimage: + linuxdeploy: + plugins: + - qt + raw_environment: + QML_SOURCES_PATHS: "\"$PROJECT_ROOT\"/src/qmlcomponents/" + environment: + EXTRA_PLATFORM_PLUGINS: "libqwayland-egl.so;libqwayland-generic.so" + EXTRA_QT_PLUGINS: "waylandcompositor" diff --git a/deploy/linux/org.mavlink.qgroundcontrol.flatpak.yml b/deploy/linux/org.mavlink.qgroundcontrol.flatpak.yml new file mode 100644 index 000000000000..2a6052de8973 --- /dev/null +++ b/deploy/linux/org.mavlink.qgroundcontrol.flatpak.yml @@ -0,0 +1,39 @@ +app-id: org.mavlink.qgroundcontrol +runtime: org.gnome.Platform +runtime-version: 47 +sdk: org.gnome.Sdk +command: QGroundControl +rename-appdata-file: org.mavlink.qgroundcontrol.metainfo.xml + +finish-args: + - --socket=wayland + - --socket=fallback-x11 + - --socket=pulseaudio + - --device=all # allow access USB Serial + - --share=ipc + - --share=network + - --filesystem=home + - --filesystem=xdg-run/gvfs # GVfs + - --filesystem=/media # automount via udisks + - --filesystem=/run/udev:ro # enables firmware upload & auto connecting + +modules: + - name: QGroundControl + sources: + - type: git + url: https://github.com/mavlink/qgroundcontrol.git + tag: master + commit: 35f7efd36e0d14e39378cc3acdbcb003b8c57921 + buildsystem: cmake-ninja + builddir: true + config-opts: + - -D BUILD_SHARED_LIBS=OFF + - -D BUILD_TESTING=OFF + cleanup: + - /include + - /bin/dbf* + - /bin/shp* + - /lib/cmake + - /share/shapelib + - '*.a' + - '*.cmake'