Skip to content

Commit 45de338

Browse files
authored
cleaned up includes based on include-what-you-use / iwyu.yml: updated to yet another distro to get the latest version and updated the Chaotic-AUR key (#5267)
This is a mess. The version is AUR is still outdated and also doesn't install anymore. Fedora 38 carries the latest version of it so use that now. Keep the old steps in case we need to switch again in the future.
1 parent 389e446 commit 45de338

53 files changed

Lines changed: 90 additions & 75 deletions

Some content is hidden

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

.github/workflows/iwyu.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-22.04
1414

1515
container:
16-
image: "archlinux:latest"
16+
image: "fedora:latest"
1717

1818
steps:
1919
- uses: actions/checkout@v3
@@ -34,15 +34,23 @@ jobs:
3434
pacman -Sy
3535
pacman -S cmake make gcc qt5-base qt5-tools qt5-charts pcre wget --noconfirm
3636
pacman-key --init
37-
pacman-key --recv-key FBA220DFC880C036 --keyserver keyserver.ubuntu.com
38-
pacman-key --lsign-key FBA220DFC880C036
37+
pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com
38+
pacman-key --lsign-key 3056513887B78AEB
3939
pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst' --noconfirm
4040
echo "[chaotic-aur]" >> /etc/pacman.conf
4141
echo "Include = /etc/pacman.d/chaotic-mirrorlist" >> /etc/pacman.conf
4242
pacman -Sy
4343
pacman -S include-what-you-use --noconfirm
4444
ln -s iwyu-tool /usr/sbin/iwyu_tool
4545
46+
# TODO: the necessary packages are excessive - mostly because of Qt - use a pre-built image
47+
- name: Install missing software on Fedora
48+
run: |
49+
dnf install -y cmake gcc-c++ qt5-qtbase-devel qt5-linguist qt5-qttools-devel qt5-qtcharts-devel pcre-devel
50+
dnf install -y wget iwyu
51+
ln -s iwyu_tool.py /usr/bin/iwyu_tool
52+
ln -s qt5 /usr/include/qt
53+
4654
- name: Prepare CMake
4755
run: |
4856
cmake -S . -B cmake.output -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCPPCHK_GLIBCXX_DEBUG=Off -DUSE_MATCHCOMPILER=Off

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ cli/stacktrace.o: cli/stacktrace.cpp cli/stacktrace.h lib/config.h lib/utils.h
667667
cli/threadexecutor.o: cli/threadexecutor.cpp cli/cppcheckexecutor.h cli/executor.h cli/threadexecutor.h lib/analyzerinfo.h lib/check.h lib/color.h lib/config.h lib/cppcheck.h lib/errorlogger.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h
668668
$(CXX) ${INCLUDE_FOR_CLI} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ cli/threadexecutor.cpp
669669

670-
test/fixture.o: test/fixture.cpp externals/tinyxml2/tinyxml2.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h test/fixture.h test/options.h test/redirect.h
670+
test/fixture.o: test/fixture.cpp externals/tinyxml2/tinyxml2.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h test/fixture.h test/options.h test/redirect.h
671671
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/fixture.cpp
672672

673673
test/helpers.o: test/helpers.cpp externals/simplecpp/simplecpp.h lib/config.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/path.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/helpers.h
@@ -862,7 +862,7 @@ test/testunusedprivfunc.o: test/testunusedprivfunc.cpp externals/simplecpp/simpl
862862
test/testunusedvar.o: test/testunusedvar.cpp externals/simplecpp/simplecpp.h lib/check.h lib/checkunusedvar.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/platform.h lib/preprocessor.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h
863863
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testunusedvar.cpp
864864

865-
test/testutils.o: test/testutils.cpp lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h test/helpers.h
865+
test/testutils.o: test/testutils.cpp lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/utils.h test/fixture.h
866866
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/testutils.cpp
867867

868868
test/testvaarg.o: test/testvaarg.cpp lib/check.h lib/checkvaarg.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/importproject.h lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h lib/suppressions.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/fixture.h

cli/cmdlineparser.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
#include <list>
4545
#include <set>
4646
#include <sstream> // IWYU pragma: keep
47-
#include <stdexcept>
4847
#include <unordered_set>
4948
#include <utility>
5049

@@ -53,10 +52,6 @@
5352
#include <tinyxml2.h>
5453
#endif
5554

56-
#ifdef __linux__
57-
#include <unistd.h>
58-
#endif
59-
6055
static bool addFilesToList(const std::string& fileList, std::vector<std::string>& pathNames)
6156
{
6257
std::istream *files;

cli/cmdlineparser.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#ifndef CMDLINE_PARSER_H
2020
#define CMDLINE_PARSER_H
2121

22+
#include <cstddef>
2223
#include <string>
2324
#include <vector>
2425

gui/compliancereportdialog.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Cppcheck - A tool for static C/C++ code analysis
3+
* Copyright (C) 2007-2023 Cppcheck team.
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
*/
18+
119
#include "compliancereportdialog.h"
220

321
#include "ui_compliancereportdialog.h"
@@ -16,6 +34,7 @@
1634

1735
#include <QByteArray>
1836
#include <QCheckBox>
37+
#include <QComboBox>
1938
#include <QCoreApplication>
2039
#include <QDialogButtonBox>
2140
#include <QDir>

gui/compliancereportdialog.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Cppcheck - A tool for static C/C++ code analysis
3+
* Copyright (C) 2007-2023 Cppcheck team.
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
*/
18+
119
#ifndef COMPLIANCEREPORTDIALOG_H
220
#define COMPLIANCEREPORTDIALOG_H
321

gui/librarydialog.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525

2626
#include "ui_librarydialog.h"
2727

28-
#include <string>
29-
3028
#include <QCheckBox>
3129
#include <QComboBox>
3230
#include <QFile>

gui/projectfile.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include "importproject.h"
2424
#include "settings.h"
2525

26-
#include <string>
2726
#include <utility>
2827

2928
#include <QFile>

gui/projectfiledialog.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,13 @@
3434
#include <string>
3535

3636
#include <QByteArray>
37-
#include <QChar>
3837
#include <QCheckBox>
3938
#include <QComboBox>
4039
#include <QCoreApplication>
4140
#include <QDialogButtonBox>
4241
#include <QDir>
43-
#include <QFile>
4442
#include <QFileDialog>
4543
#include <QFileInfo>
46-
#include <QFileInfoList>
4744
#include <QFlags>
4845
#include <QLabel>
4946
#include <QLineEdit>

gui/resultstree.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
#include "threadhandler.h"
3232
#include "xmlreportv2.h"
3333

34-
#include <string>
35-
3634
#include <QAction>
3735
#include <QApplication>
3836
#include <QClipboard>

0 commit comments

Comments
 (0)