Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
fefedd0
refactor: Format inc files
ltoenning Oct 11, 2025
036a99f
build: Fix compilation with no PCH
ltoenning Oct 25, 2025
0646900
fix: Extend comment for new simulators
ltoenning Oct 4, 2025
8c93f00
refactor: Fix deprecation warning
ltoenning Oct 11, 2025
e29818a
refactor: Move chunkware to third_party
ltoenning Oct 10, 2025
899b5d6
ci: Run static code analysis
ltoenning Oct 25, 2025
29bc905
refactor: Fix clang-tidy modernize-use-auto
ltoenning Oct 9, 2025
8f946b7
refactor: Fix clang-tidy modernize-use-override
ltoenning Oct 9, 2025
e094136
refactor: Fix clang-tidy modernize-return-braced-init-list
ltoenning Oct 10, 2025
4e6a688
refactor: Fix clang-tidy modernize-loop-convert
ltoenning Oct 11, 2025
3694501
refactor: Fix remaining modernize- warnings
ltoenning Oct 25, 2025
8a877e8
refactor: Fix readability-use-std-min-max
ltoenning Oct 25, 2025
3758b2b
refactor: Fix readability-use-anyofallof
ltoenning Oct 25, 2025
fc54023
refactor: Fix readability-redundant-member-init warning
ltoenning Oct 25, 2025
5eafb12
refactor: Fix cppcoreguidelines-init-variables warnings
ltoenning Oct 25, 2025
469d9b8
refactor: Fix readability-static-accessed-through-instance warnings
ltoenning Oct 25, 2025
7579ce8
refactor: Fix readability-simplify-boolean-expr
ltoenning Oct 25, 2025
707eaf0
refactor: Fix readability-use-concise-preprocessor-directives
ltoenning Oct 25, 2025
d23b684
fix: Supress false positives
ltoenning Oct 31, 2025
1bf664f
build: Fix build on Windows
ltoenning Nov 1, 2025
0d79817
fix: Avoid implicit conversion
ltoenning Nov 1, 2025
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: 48 additions & 27 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,33 +1,54 @@
# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors
# SPDX-License-Identifier: CC0-1.0

Checks:
- '-*'
- 'modernize-*'
- '-modernize-use-trailing-return-type'
- '-modernize-use-nodiscard'
- '-modernize-pass-by-value'
- '-modernize-avoid-c-arrays'
- 'bugprone-*'
- '-bugprone-easily-swappable-parameters'
- 'readability-*'
- '-readability-identifier-length'
- '-readability-implicit-bool-conversion'
- '-readability-braces-around-statements'
- '-readability-function-cognitive-complexity'
- '-readability-convert-member-functions-to-static'
- '-readability-math-missing-parentheses'
- '-readability-avoid-unconditional-preprocessor-if'
- '-readability-magic-numbers'
- '-readability-container-size-empty'
- 'cppcoreguidelines-*'
- '-cppcoreguidelines-avoid-magic-numbers'
- '-cppcoreguidelines-non-private-member-variables-in-classes'
- '-cppcoreguidelines-avoid-c-arrays'
- '-cppcoreguidelines-owning-memory'
- '-cppcoreguidelines-misleading-capture-default-by-value'
- '-cppcoreguidelines-pro-bounds-array-to-pointer-decay'

Checks: >
-*,
modernize-avoid-bind,
modernize-concat-nested-namespaces,
modernize-deprecated-headers,
modernize-deprecated-ios-base-aliases,
modernize-loop-convert,
modernize-macro-to-enum,
modernize-make-shared,
modernize-make-unique,
modernize-min-max-use-initializer-list,
modernize-raw-string-literal,
modernize-redundant-void-arg,
modernize-replace-auto-ptr,
modernize-replace-disallow-copy-and-assign-macro,
modernize-replace-random-shuffle,
modernize-return-braced-init-list,
modernize-shrink-to-fit,
modernize-type-traits,
modernize-unary-static-assert,
modernize-use-auto,
modernize-use-bool-literals,
modernize-use-constraints,
modernize-use-default-member-init,
modernize-use-designated-initializers,
modernize-use-emplace,
modernize-use-equals-default,
modernize-use-equals-delete,
modernize-use-integer-sign-comparison,
modernize-use-noexcept,
modernize-use-nullptr,
modernize-use-override,
modernize-use-ranges,
modernize-use-scoped-lock,
modernize-use-starts-ends-with,
modernize-use-std-format,
modernize-use-std-numbers,
modernize-use-std-print,
modernize-use-transparent-functors,
modernize-use-uncaught-exceptions,
modernize-use-using,
readability-use-std-min-max,
readability-use-anyofallof,
readability-redundant-member-init,
cppcoreguidelines-init-variables,
readability-static-accessed-through-instance,
readability-simplify-boolean-expr,
readability-use-concise-preprocessor-directives,

CheckOptions:
- key: readability-identifier-naming.ClassCase
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ env:
do_vatsim_key: ${{ github.event_name == 'push' }}
do_symbols: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
do_doxygen: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
do_static_analysis: ${{ github.event_name == 'push' && github.ref != 'refs/heads/main' }}
qt_version: 6.10.0
bitrock_version: qt-professional-24.7.0
bitrock_url: https://releases.installbuilder.com/installbuilder
Expand Down Expand Up @@ -104,6 +105,62 @@ jobs:
uses: actions/upload-pages-artifact@v3
with:
path: docs/html/
- name: Check if clang-tidy analysis is required
id: check_need_clang_tidy
run: |
if python3 -u scripts/run_static_analysis.py --check-changed-files; then
echo "should_run_clang_tidy=false" >> $GITHUB_OUTPUT
else
echo "should_run_clang_tidy=true" >> $GITHUB_OUTPUT
fi
- name: Checkout repository
if: ${{ steps.check_need_clang_tidy.outputs.should_run_clang_tidy == 'true' }}
uses: actions/checkout@v4
with:
fetch-depth: '0'
submodules: 'true'
- name: Install Qt
if: ${{ steps.check_need_clang_tidy.outputs.should_run_clang_tidy == 'true' }}
uses: jurplel/install-qt-action@v4
with:
version: ${{ env.qt_version }}
modules: 'qtmultimedia'
cache: true
- name: Install dependencies
if: ${{ steps.check_need_clang_tidy.outputs.should_run_clang_tidy == 'true' }}
run: |
sudo apt-get -y install dbus-x11 libglu1-mesa-dev libpulse-dev libdbus-1-dev ninja-build
pip3 install requests conan
- name: Checkout externals
if: ${{ env.use_externals == 'true' && steps.check_need_clang_tidy.outputs.should_run_clang_tidy == 'true' }}
uses: actions/checkout@v4
env:
EXTERNALS_PAT: ${{ secrets.EXTERNALS_PAT }}
with:
repository: ${{ env.externals }}
ref: ${{ env.externals_sha }}
token: ${{ env.EXTERNALS_PAT }}
path: 'third_party/externals'
- name: Install conan dependencies
if: ${{ steps.check_need_clang_tidy.outputs.should_run_clang_tidy == 'true' }}
shell: bash
env:
ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }}
ARTIFACTORY_TOKEN: ${{ secrets.ARTIFACTORY_TOKEN }}
run: |
conan profile detect
conan remote disable conancenter
conan remote add swift https://artifactory.swift-project.org/artifactory/api/conan/conan-local
conan remote login swift "$ARTIFACTORY_USER" --password "$ARTIFACTORY_TOKEN"
conan install . --output-folder=build_conan --deployer=full_deploy -pr=ci/profile_linux
- name: Run clang-tidy
if: ${{ steps.check_need_clang_tidy.outputs.should_run_clang_tidy == 'true' }}
shell: bash
run: |
mkdir build && pushd build
cmake .. --preset ci-build-linux-no-pch
popd
python3 scripts/run_static_analysis.py --clang-tidy --build-path build --changed-files-ci

buildLinux:
runs-on: ubuntu-22.04
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ option(SWIFT_MINIFY_DEBUG_SYMBOLS "Minify debug symbols" OFF)
option(SWIFT_ONLY_XSWIFTBUS_WORKAROUND "Only build xswiftbus (useful when compiling on ARM)" OFF)

option(SWIFT_USE_CRASHPAD "Use crashpad" OFF)
option(SWIFT_USE_PCH "Use precompiled headers" ON)


# Shortcut to only build xswiftbus
Expand Down
16 changes: 16 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,22 @@
"SWIFT_USE_CRASHPAD": "OFF"
}
},
{
"name": "ci-build-linux-no-pch",
"displayName": "CI Build Linux without PCH (used for static code analysis)",
"inherits": "ci-build-linux",
"generator": "Ninja",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Linux"
},
"cacheVariables": {
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"VATSIM_KEY_JSON": "",
"SWIFT_USE_PCH": "OFF"
}
},
{
"name": "dev-debug",
"displayName": "Development Debug",
Expand Down
6 changes: 3 additions & 3 deletions samples/afvclient/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ int main(int argc, char *argv[])
swift::core::registerMetadata();
swift::core::CApplication a("sampleafvclient", CApplicationInfo::Sample);

CAfvMapReader *afvMapReader = new CAfvMapReader(&a);
auto *afvMapReader = new CAfvMapReader(&a);
afvMapReader->updateFromMap();

CAfvClient *voiceClient = new CAfvClient("https://voice1.vatsim.net", &qa);
auto *voiceClient = new CAfvClient("https://voice1.vatsim.net", &qa);
voiceClient->start(QThread::TimeCriticalPriority); // background thread
CAfvClientBridge *voiceClientBridge = new CAfvClientBridge(voiceClient, &qa);
auto *voiceClientBridge = new CAfvClientBridge(voiceClient, &qa);

QObject::connect(&qa, &QCoreApplication::aboutToQuit, [voiceClient]() { voiceClient->quitAndWait(); });

Expand Down
6 changes: 3 additions & 3 deletions samples/miscquantities/samplesphysicalquantities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ namespace swift::sample
out << f1 << " " << f1.valueRoundedWithUnit(CFrequencyUnit::MHz()) << " "
<< f1.valueRoundedWithUnit(CFrequencyUnit::GHz(), 3);

CSpeed s1 = CSpeed(100, CSpeedUnit::km_h());
CSpeed s2 = CSpeed(1000, CSpeedUnit::ft_min());
CSpeed s3 = CSpeed(s2);
CSpeed s1(100, CSpeedUnit::km_h());
CSpeed s2(1000, CSpeedUnit::ft_min());
CSpeed s3(s2);
s3.switchUnit(CSpeedUnit::m_s());
out << s1 << " " << s1.valueRoundedWithUnit(CSpeedUnit::defaultUnit()) << " "
<< s1.valueRoundedWithUnit(CSpeedUnit::NM_h());
Expand Down
3 changes: 2 additions & 1 deletion scripts/run_clang_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@


def should_file_formatted(file) -> bool:
return file.endswith(".cpp") or file.endswith(".h")
excluded_filenames = ["datarefs.inc"]
return file not in excluded_filenames and (file.endswith(".cpp") or file.endswith(".h") or file.endswith(".inc"))


def get_formattable_files(folder_name):
Expand Down
43 changes: 0 additions & 43 deletions scripts/run_clang_tidy.py

This file was deleted.

Loading
Loading