Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iwyu.yml: use OpenSUSE to get latest include-what-you-use / cleaned up includes #5673

Merged
merged 2 commits into from
Mar 8, 2024
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions .github/workflows/iwyu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:

strategy:
matrix:
image: ["fedora:latest"] # "debian:unstable" / "archlinux:latest"
image: ["opensuse/tumbleweed:latest"] # "fedora:latest" / "debian:unstable" / "archlinux:latest"

runs-on: ubuntu-22.04

container:
image: "fedora:latest"
image: ${{ matrix.image }}

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -60,6 +60,14 @@ jobs:
ln -s iwyu_tool.py /usr/bin/iwyu_tool
ln -s qt5 /usr/include/qt

- name: Install missing software on OpenSUSE
if: contains(matrix.image, 'opensuse')
run: |
zypper install -y cmake gcc-c++ pcre-devel libQt5Core-devel libQt5Gui-devel libQt5Widgets-devel libQt5PrintSupport-devel libqt5-linguist-devel libqt5-qttools-devel libQt5Network-devel libQt5Charts5-devel libQt5Test-devel
zypper install -y wget include-what-you-use-tools
ln -s iwyu_tool.py /usr/bin/iwyu_tool
ln -s qt5 /usr/include/qt

# TODO: switch to Qt 6 after we enabled the Qt mappings again
- name: Prepare CMake
run: |
Expand All @@ -86,7 +94,8 @@ jobs:
- name: iwyu_tool
run: |
PWD=$(pwd)
iwyu_tool -p cmake.output -j $(nproc) -- -w -Xiwyu --max_line_length=1024 -Xiwyu --comment_style=long -Xiwyu --quoted_includes_first -Xiwyu --update_comments -Xiwyu --mapping_file=$PWD/qt5.imp -isystem/usr/lib/clang/17/include > iwyu.log
# -isystem/usr/lib/clang/17/include
iwyu_tool -p cmake.output -j $(nproc) -- -w -Xiwyu --max_line_length=1024 -Xiwyu --comment_style=long -Xiwyu --quoted_includes_first -Xiwyu --update_comments -Xiwyu --mapping_file=$PWD/qt5.imp > iwyu.log

- uses: actions/upload-artifact@v3
if: success() || failure()
Expand Down
4 changes: 2 additions & 2 deletions cli/cmdlineparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@
#include <cstdio>
#include <cstdlib> // EXIT_FAILURE
#include <cstring>
#include <fstream> // IWYU pragma: keep
#include <fstream>
#include <iostream>
#include <iterator>
#include <list>
#include <set>
#include <sstream> // IWYU pragma: keep
#include <sstream>
#include <unordered_set>
#include <utility>

Expand Down
3 changes: 2 additions & 1 deletion cli/cppcheckexecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@
#include <cstdio>
#include <cstdlib> // EXIT_SUCCESS and EXIT_FAILURE
#include <ctime>
#include <fstream>
#include <iostream>
#include <list>
#include <set>
#include <sstream> // IWYU pragma: keep
#include <sstream>
#include <unordered_set>
#include <utility>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion cli/executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "suppressions.h"

#include <cassert>
#include <sstream> // IWYU pragma: keep
#include <sstream>
#include <utility>

struct FileSettings;
Expand Down
3 changes: 2 additions & 1 deletion cli/processexecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@
#include <iostream>
#include <list>
#include <map>
#include <sstream> // IWYU pragma: keep
#include <sstream>
#include <sys/select.h>
#include <sys/time.h>
#include <sys/wait.h>
#include <unistd.h>
#include <utility>
Expand Down
4 changes: 2 additions & 2 deletions externals/simplecpp/simplecpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
#include <cstring>
#include <ctime>
#include <exception>
#include <fstream> // IWYU pragma: keep
#include <fstream>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <set>
#include <sstream> // IWYU pragma: keep
#include <sstream>
#include <stack>
#include <stdexcept>
#include <string>
Expand Down
2 changes: 1 addition & 1 deletion gui/checkthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@

#include <algorithm>
#include <cstddef>
#include <fstream>
#include <iterator>
#include <list>
#include <ostream>
#include <set>
#include <string>
#include <utility>
Expand Down
1 change: 0 additions & 1 deletion lib/analyzerinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

#include <cstring>
#include <map>
#include <sstream> // IWYU pragma: keep

#include "xml.h"

Expand Down
1 change: 0 additions & 1 deletion lib/checkersreport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include <map>
#include <sstream>
#include <unordered_set>
#include <utility>
#include <vector>

static bool isCppcheckPremium(const Settings& settings) {
Expand Down
1 change: 0 additions & 1 deletion lib/checkfunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

#include <map>
#include <string>
#include <utility>

class Token;
class ErrorLogger;
Expand Down
2 changes: 1 addition & 1 deletion lib/checkio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <list>
#include <map>
#include <set>
#include <sstream> // IWYU pragma: keep
#include <sstream>
#include <unordered_set>
#include <utility>
#include <vector>
Expand Down
1 change: 0 additions & 1 deletion lib/checkleakautovar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
#include <cstddef>
#include <iostream>
#include <list>
#include <utility>
#include <vector>

//---------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion lib/checkleakautovar.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include <map>
#include <set>
#include <string>
#include <utility>

class ErrorLogger;
class Settings;
Expand Down
1 change: 0 additions & 1 deletion lib/checkuninitvar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
#include <list>
#include <map>
#include <unordered_set>
#include <utility>
#include <vector>


Expand Down
4 changes: 2 additions & 2 deletions lib/checkunusedfunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
#include <algorithm>
#include <cctype>
#include <cstring>
#include <fstream> // IWYU pragma: keep
#include <fstream>
#include <map>
#include <sstream> // IWYU pragma: keep
#include <sstream>
#include <tuple>
#include <utility>
#include <vector>
Expand Down
1 change: 0 additions & 1 deletion lib/checkunusedvar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "symboldatabase.h"
#include "token.h"
#include "tokenize.h"
#include "tokenlist.h"
#include "utils.h"
#include "valueflow.h"

Expand Down
2 changes: 1 addition & 1 deletion lib/clangimport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <map>
#include <memory>
#include <set>
#include <sstream> // IWYU pragma: keep
#include <sstream>
#include <stack>
#include <string>
#include <utility>
Expand Down
2 changes: 1 addition & 1 deletion lib/color.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#ifndef _WIN32
#include <unistd.h>
#include <cstddef>
#include <sstream> // IWYU pragma: keep
#include <sstream>
#include <iostream>
#endif

Expand Down
4 changes: 2 additions & 2 deletions lib/cppcheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@
#include <cctype>
#include <cstdlib>
#include <ctime>
#include <exception>
#include <exception> // IWYU pragma: keep
#include <fstream>
#include <iostream> // <- TEMPORARY
#include <new>
#include <set>
#include <sstream> // IWYU pragma: keep
#include <sstream>
#include <stdexcept>
#include <string>
#include <unordered_set>
Expand Down
3 changes: 1 addition & 2 deletions lib/cppcheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,14 @@
#include "settings.h"

#include <cstddef>
#include <fstream> // IWYU pragma: keep
#include <fstream>
#include <functional>
#include <list>
#include <map>
#include <memory>
#include <set>
#include <string>
#include <unordered_set>
#include <utility>
#include <vector>

class Tokenizer;
Expand Down
3 changes: 2 additions & 1 deletion lib/errorlogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
#include <cassert>
#include <cctype>
#include <cstring>
#include <fstream>
#include <iomanip>
#include <sstream> // IWYU pragma: keep
#include <sstream>
#include <string>
#include <unordered_map>
#include <utility>
Expand Down
1 change: 0 additions & 1 deletion lib/fwdanalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <list>
#include <map>
#include <string>
#include <utility>

static bool isUnchanged(const Token *startToken, const Token *endToken, const std::set<nonneg int> &exprVarIds, bool local)
{
Expand Down
4 changes: 2 additions & 2 deletions lib/importproject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
#include <algorithm>
#include <cstdlib>
#include <cstring>
#include <fstream> // IWYU pragma: keep
#include <fstream>
#include <iostream>
#include <iterator>
#include <sstream> // IWYU pragma: keep
#include <sstream>
#include <unordered_set>
#include <utility>

Expand Down
2 changes: 1 addition & 1 deletion lib/library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include <cstring>
#include <list>
#include <memory>
#include <sstream> // IWYU pragma: keep
#include <sstream>
#include <stack>
#include <stdexcept>
#include <string>
Expand Down
1 change: 1 addition & 0 deletions lib/path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <simplecpp.h>

#ifndef _WIN32
#include <sys/types.h>
#include <unistd.h>
#else
#include <direct.h>
Expand Down
2 changes: 1 addition & 1 deletion lib/preprocessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <array>
#include <cstddef>
#include <iterator> // back_inserter
#include <sstream> // IWYU pragma: keep
#include <sstream>
#include <utility>

#include <simplecpp.h>
Expand Down
5 changes: 3 additions & 2 deletions lib/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
#include "vfvalue.h"

#include <cctype>
#include <fstream> // IWYU pragma: keep
#include <sstream> // IWYU pragma: keep
#include <fstream>
#include <sstream>
#include <utility>

#include "json.h"

Expand Down
4 changes: 2 additions & 2 deletions lib/summaries.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
#include "tokenlist.h"

#include <algorithm>
#include <fstream> // IWYU pragma: keep
#include <fstream>
#include <map>
#include <sstream> // IWYU pragma: keep
#include <sstream>
#include <utility>
#include <vector>

Expand Down
2 changes: 1 addition & 1 deletion lib/suppressions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <cctype> // std::isdigit, std::isalnum, etc
#include <cstring>
#include <functional> // std::bind, std::placeholders
#include <sstream> // IWYU pragma: keep
#include <sstream>
#include <utility>

#include "xml.h"
Expand Down
2 changes: 1 addition & 1 deletion lib/symboldatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#include <iomanip>
#include <iostream>
#include <iterator>
#include <sstream> // IWYU pragma: keep
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
Expand Down
2 changes: 1 addition & 1 deletion lib/token.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include <iterator>
#include <map>
#include <set>
#include <sstream> // IWYU pragma: keep
#include <sstream>
#include <stack>
#include <type_traits>
#include <unordered_set>
Expand Down
2 changes: 1 addition & 1 deletion lib/tokenize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#include <exception>
#include <memory>
#include <set>
#include <sstream> // IWYU pragma: keep
#include <sstream>
#include <stack>
#include <stdexcept>
#include <unordered_map>
Expand Down
2 changes: 1 addition & 1 deletion lib/valueflow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
#include <memory>
#include <numeric>
#include <set>
#include <sstream> // IWYU pragma: keep
#include <sstream>
#include <string>
#include <type_traits>
#include <unordered_map>
Expand Down
2 changes: 1 addition & 1 deletion test/helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <cerrno>
#include <cstdio>
#include <iostream>
#include <fstream> // IWYU pragma: keep
#include <fstream>
#include <list>
#include <map>
#include <stdexcept>
Expand Down
2 changes: 1 addition & 1 deletion test/helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "tokenlist.h"

#include <cstddef>
#include <sstream> // IWYU pragma: keep
#include <sstream>
#include <string>
#include <vector>

Expand Down
2 changes: 1 addition & 1 deletion test/test64bit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "fixture.h"
#include "tokenize.h"

#include <sstream> // IWYU pragma: keep
#include <sstream>

class Test64BitPortability : public TestFixture {
public:
Expand Down
Loading
Loading