cleaned up includes based on `include-what-you-use` (#5021)

This commit is contained in:
Oliver Stöneberg 2023-04-30 07:33:19 +02:00 committed by GitHub
parent 51cba8162b
commit 8cf6a22ea3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 24 additions and 16 deletions

View File

@ -670,7 +670,7 @@ cli/threadexecutor.o: cli/threadexecutor.cpp cli/cppcheckexecutor.h cli/executor
test/fixture.o: test/fixture.cpp lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/suppressions.h test/fixture.h test/options.h test/redirect.h test/fixture.o: test/fixture.cpp lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/suppressions.h test/fixture.h test/options.h test/redirect.h
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/fixture.cpp $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/fixture.cpp
test/helpers.o: test/helpers.cpp externals/simplecpp/simplecpp.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/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 test/helpers.o: test/helpers.cpp externals/simplecpp/simplecpp.h lib/config.h lib/errortypes.h lib/mathlib.h lib/path.h lib/preprocessor.h lib/templatesimplifier.h lib/token.h lib/tokenize.h lib/tokenlist.h lib/utils.h lib/vfvalue.h test/helpers.h
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/helpers.cpp $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CXXFLAGS) -c -o $@ test/helpers.cpp
test/main.o: test/main.cpp externals/simplecpp/simplecpp.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/preprocessor.h lib/suppressions.h test/fixture.h test/options.h test/main.o: test/main.cpp externals/simplecpp/simplecpp.h lib/check.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/preprocessor.h lib/suppressions.h test/fixture.h test/options.h

View File

@ -21,6 +21,7 @@
#include "check.h" #include "check.h"
#include "config.h" #include "config.h"
#include "cppcheckexecutor.h" #include "cppcheckexecutor.h"
#include "errorlogger.h"
#include "errortypes.h" #include "errortypes.h"
#include "filelister.h" #include "filelister.h"
#include "importproject.h" #include "importproject.h"

View File

@ -24,7 +24,6 @@
#include "suppressions.h" #include "suppressions.h"
#include <algorithm> #include <algorithm>
#include <iostream>
#include <sstream> // IWYU pragma: keep #include <sstream> // IWYU pragma: keep
#include <utility> #include <utility>

View File

@ -20,7 +20,6 @@
#if !defined(WIN32) && !defined(__MINGW32__) #if !defined(WIN32) && !defined(__MINGW32__)
#include "color.h"
#include "config.h" #include "config.h"
#include "cppcheck.h" #include "cppcheck.h"
#include "cppcheckexecutor.h" #include "cppcheckexecutor.h"
@ -56,6 +55,8 @@
#include <sys/prctl.h> #include <sys/prctl.h>
#endif #endif
enum class Color;
// NOLINTNEXTLINE(misc-unused-using-decls) - required for FD_ZERO // NOLINTNEXTLINE(misc-unused-using-decls) - required for FD_ZERO
using std::memset; using std::memset;

View File

@ -24,7 +24,6 @@
#include "ui_newsuppressiondialog.h" #include "ui_newsuppressiondialog.h"
#include <functional>
#include <string> #include <string>
#include <QComboBox> #include <QComboBox>

View File

@ -26,6 +26,7 @@
#include "symboldatabase.h" #include "symboldatabase.h"
#include "token.h" #include "token.h"
#include "tokenize.h" #include "tokenize.h"
#include "utils.h"
#include "vfvalue.h" #include "vfvalue.h"
#include <algorithm> #include <algorithm>

View File

@ -29,6 +29,7 @@
#include "token.h" #include "token.h"
#include "tokenize.h" #include "tokenize.h"
#include "tokenlist.h" #include "tokenlist.h"
#include "utils.h"
#include <algorithm> #include <algorithm>
#include <cctype> #include <cctype>

View File

@ -24,6 +24,7 @@
#include "path.h" #include "path.h"
#include "token.h" #include "token.h"
#include "tokenlist.h" #include "tokenlist.h"
#include "utils.h"
#include <algorithm> #include <algorithm>
#include <array> #include <array>
@ -32,9 +33,9 @@
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <iomanip> #include <iomanip>
#include <limits>
#include <sstream> // IWYU pragma: keep #include <sstream> // IWYU pragma: keep
#include <string> #include <string>
#include <unordered_map>
#include <utility> #include <utility>
#include <tinyxml2.h> #include <tinyxml2.h>

View File

@ -22,8 +22,10 @@
#include "preprocessor.h" #include "preprocessor.h"
#include <cstdio> #include <cstdio>
#include <fstream>
#include <stdexcept> #include <stdexcept>
#include <utility> #include <utility>
#include <vector>
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <windows.h>
@ -34,6 +36,8 @@
#include <simplecpp.h> #include <simplecpp.h>
class Suppressions;
ScopedFile::ScopedFile(std::string name, const std::string &content, std::string path) ScopedFile::ScopedFile(std::string name, const std::string &content, std::string path)
: mName(std::move(name)) : mName(std::move(name))
, mPath(Path::toNativeSeparators(std::move(path))) , mPath(Path::toNativeSeparators(std::move(path)))

View File

@ -19,20 +19,16 @@
#ifndef helpersH #ifndef helpersH
#define helpersH #define helpersH
#include "color.h"
#include "errorlogger.h"
#include "settings.h"
#include "suppressions.h"
#include "tokenize.h" #include "tokenize.h"
#include "tokenlist.h" #include "tokenlist.h"
#include <fstream> // IWYU pragma: keep
#include <list>
#include <sstream> // IWYU pragma: keep #include <sstream> // IWYU pragma: keep
#include <string> #include <string>
class Token; class Token;
class Processor; class Preprocessor;
class Settings;
class Suppressions;
class givenACodeSampleToTokenize { class givenACodeSampleToTokenize {
private: private:

View File

@ -17,7 +17,7 @@
*/ */
#include "cmdlineparser.h" #include "cmdlineparser.h"
#include "color.h" #include "config.h"
#include "cppcheckexecutor.h" #include "cppcheckexecutor.h"
#include "errortypes.h" #include "errortypes.h"
#include "platform.h" #include "platform.h"

View File

@ -23,7 +23,6 @@
#include "fixture.h" #include "fixture.h"
#include <algorithm> #include <algorithm>
#include <functional>
#include <list> #include <list>
#include <string> #include <string>

View File

@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "color.h"
#include "config.h" #include "config.h"
#include "cppcheck.h" #include "cppcheck.h"
#include "errorlogger.h" #include "errorlogger.h"

View File

@ -26,8 +26,11 @@
#include <simplecpp.h> #include <simplecpp.h>
#include <map>
#include <sstream> // IWYU pragma: keep #include <sstream> // IWYU pragma: keep
#include <string> #include <string>
#include <utility>
#include <vector>
class TestSimplifyUsing : public TestFixture { class TestSimplifyUsing : public TestFixture {

View File

@ -39,7 +39,6 @@
#include <string> #include <string>
#include <utility> #include <utility>
#include <vector> #include <vector>
#include <numeric>
class TestSuppressions : public TestFixture { class TestSuppressions : public TestFixture {
public: public:

View File

@ -21,6 +21,11 @@
#include "settings.h" #include "settings.h"
#include "utils.h" #include "utils.h"
#include <cstddef>
#include <cstdint>
#include <limits>
#include <string>
const Settings givenACodeSampleToTokenize::settings; const Settings givenACodeSampleToTokenize::settings;
class TestUtils : public TestFixture { class TestUtils : public TestFixture {