summaryrefslogtreecommitdiff
path: root/src/plugins/cppcheck/cppchecktool.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-071-1/+1
| | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. Task-number: QTBUG-99313 Change-Id: I88edd91395849574436299b8badda21bb93bea39 Reviewed-by: hjk <hjk@qt.io>
* Use SPDX license identifiersLucie GĂ©rard2022-08-261-24/+2
| | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Task-number: QTBUG-67283 Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Cppcheck: Escape error message format stringSergey Morozov2022-05-021-1/+1
| | | | | | | | | Some shells try to expand {} otherwise. Fixes: QTCREATORBUG-27284 Change-Id: Ifd2bd7bc58f005339eebd150b98ced59395d24bc Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Rename QtSupport::BaseQtVersion to QtVersionhjk2022-01-241-1/+1
| | | | | | | | | | ... and the Utils::QtVersion enum to Utils::QtMajorVersion to avoid conflicts. Change-Id: Ib688c67388272b7204a91444155f60b8c18a56bd Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Merge CppTools into CppEditorChristian Kandeler2021-09-011-9/+9
| | | | | | | | | | | | | | | | There was no proper separation of responsibilities between these plugins. In particular, CppTools had lots of editor-related functionality, so it's not clear why it was separated out in the first place. In fact, for a lot of code, it seemed quite arbitrary where it was put (just one example: switchHeaderSource() was in CppTools, wheras switchDeclarationDefinition() was in CppEditor). Merging the plugins will enable us to get rid of various convoluted pseudo-abstractions that were only introduced to keep up the artificial separation. Change-Id: Iafc3bce625b4794f6d4aa03df6cddc7f2d26716a Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CppTools: Use only const pointers for ProjectInfo and ProjectPartChristian Kandeler2021-08-271-5/+5
| | | | | | | | All members were already const, but this makes it clear at all points of use that these data structures are immutable. Change-Id: Iea615c090bde462c445d15223caccc561b0c713d Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Merge remote-tracking branch 'origin/5.0'Eike Ziller2021-08-261-1/+2
|\ | | | | | | | | | | | | | | Conflicts: qbs/modules/qtc/qtc.qbs src/plugins/android/androidconfigurations.cpp Change-Id: If8dc2cdf131811e08ca147c6f58dbb3ed3bf7227
| * CppTools: Code model fix for C++20, MSVC, and newer CMake versionsCristian Adam2021-08-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Starting with version 3.20 CMake adds -std:c++20, which breaks the code model when using MSVC. Clang-cl 12 doesn't know about -std:c++20, but clang driver knows about -std=c++20. Fixes: QTCREATORBUG-26146 Change-Id: I696842e11b0a9ba8849455d2f81f8dde6dd95a27 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* | CppTools: Turn some classes into pure value typesChristian Kandeler2021-08-131-2/+5
|/ | | | | | | | | | | | | ProjectInfo, ProjectPart and ProjectUpdateInfo used to carry pointers to Project and/or Toolchain, even though they were used in contexts where these pointers were either unsafe to access or not guaranteed to be valid anymore, which made their use difficult and error-prone. We turn these classes into pure value types by copying in all relevant information before the first async operation takes place. Fixes: QTCREATORBUG-25678 Change-Id: I1914b0dbda6c7dfba6c95e5e92f2d69977755590 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Use new, more evocative MessageManager APIEike Ziller2020-12-161-4/+4
| | | | | | | At various places where semantics doesn't change. Change-Id: Ib4d4a5c9f067e109126c6de88257f9e198a71447 Reviewed-by: hjk <hjk@qt.io>
* Utils: Fix matching wildcards to full pathsChristian Stenger2020-10-191-1/+2
| | | | | | Fixes: QTCREATORBUG-24792 Change-Id: I82b4edea6260b07e1bdff065b157a4cd044ec629 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* CppCheck: Replace QRegExp by QRegularExpressionChristian Stenger2020-07-131-2/+4
| | | | | | Task-number: QTCREATORBUG-24098 Change-Id: I7b9198f3762f5fa753b5be0e1c0a81abc7f94560 Reviewed-by: hjk <hjk@qt.io>
* Core/Utils: Migrate further to Utils::Idhjk2020-07-061-1/+1
| | | | | | | The coreplugin/id.h header is kept for downstream for now. Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Utils: Rename FilePathList to simply FilePathshjk2019-12-181-5/+5
| | | | | | | The exact storage type does not really matter here. Change-Id: Iefec40f0f5909c8e7ba3415db4a11962694e1b38 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Cppcheck: Add ability to manually run cppcheckSergey Morozov2019-12-041-7/+7
| | | | | | | | | Run cppcheck on selected files from current project via "Analyze"->"Cppcheck...." Show results in a separate view in the same manner as ClangTools plugin. Fixes: QTCREATORBUG-21673 Change-Id: Ibcaf4057a387a990f1da59025f15ba58f996953f Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* CppTools: Move QtVersion and BuildTargetTypeEike Ziller2019-09-101-2/+1
| | | | | | | | | | | | | QtVersion to utils/cpplanguage_details.h which already contains similar flags. BuildTargetType to ProjectExplorer, next to BuildTargetInfo (but not in the same header to not pull that in everywhere). Removes dependency on ProjectPart from RawProjectPart. Change-Id: I5791065e4266f20c2657ee4b1b594df04b238a1c Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Utils: Rename FileName to FilePathhjk2019-05-281-8/+8
| | | | | | | | More in line with QFileInfo terminonlogy which appears to be best-of-breed within Qt. Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix Utils::LanguageVersion::None handlingMarco Bubke2019-04-041-0/+2
| | | | | Change-Id: Id0d8bd59c1a317103ea309ee2f9b982ecfd6d6c7 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* Utils: Move C++ language details from ProjectExplorer to UtilsMarco Bubke2019-01-151-1/+1
| | | | | | | | We want to use them in the backend processes too so it's nice to share them in Utils. A concrete size was added too because they should be serialized. Change-Id: Id5eb8f46643d5159f034fc9559f68a08d7e5847a Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* CppTools/ProjectExplorer: Remove enum duplicationNikolai Kosjar2018-10-081-1/+1
| | | | | | | | ... between CppTools::ProjectPart and ProjectExplorer::ToolChain. Change-Id: I8b448747e454adbed77547460383b8515462cc81 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* Toolchains: Detect unspecified language versionNikolai Kosjar2018-10-081-0/+4
| | | | | | | | | | | | | | | | | | | | We checked the command line from the project manager for "-std=X" and friends to figure out the language version to use. However, if such a flag was not provided, we assumed the latest version we support. This could conflict with the actual version of the compiler and its predefined macros. Figure out the version by inspecting __cplusplus/__STDC_VERSION__ in the predefined macros of the toolchain. The MSVC compiler is an exception to this, as it does not seem to properly set the value - check for _MSVC_LANG if possible, otherwise simply assume some versions as before. While at it, add also support for C17/C18 and the upcoming C++2a. Task-number: QTCREATORBUG-20884 Task-number: QTCREATORBUG-21188 Change-Id: I464ffcd52d2120c0208275a050e82efda44fae1c Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* Cppcheck: Kill current check process only when neededSergey Morozov2018-09-301-1/+1
| | | | | | | Kill only if it processes specified files Change-Id: I5dee99ec8aeaf3bf4d9dbf6aad195f54176170a2 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Cppcheck: Fix progress parsingSergey Morozov2018-09-281-1/+1
| | | | | Change-Id: I14bc5b93b00fee25d9e307606c4fc7b30ca23fe8 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Cppcheck: Reduce uses of autoOrgad Shaneh2018-09-261-25/+22
| | | | | | | Conform to coding rules. Change-Id: I57600bd450665d5db87710bb2444e39e7ecbf3e3 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Cppcheck: Add cppcheck static analysis toolSergey Morozov2018-09-181-0/+324
Automatically checks currently opened documents and displays results via text marks/annotations. CppcheckTrigger detects when to check files or clear results. CppcheckTextMarkManager stores/clears text marks with checks' results. CppcheckTool generates run arguments and parses output. CppcheckRunner runs cppcheck binary. CppcheckOptions configures CppcheckTool. Task-number: QTCREATORBUG-20418 Change-Id: I8eafeac7af6137d2c9061ae75d4a56c85b3b5a2d Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: Marco Bubke <marco.bubke@qt.io>