aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/clangtools/clangtoolruncontrol.h
Commit message (Collapse)AuthorAgeFilesLines
* ClangTools: Get rid of ClangToolRunWorkerJarek Kobus2023-07-061-77/+0
| | | | | | Task-number: QTCREATORBUG-29168 Change-Id: I07ae5cd23124e43878d2f929d7dcb4fe84e8b28c Reviewed-by: hjk <hjk@qt.io>
* ClangToolRunWorker: Remove unused fieldsJarek Kobus2023-07-051-2/+0
| | | | | Change-Id: I599196e436d1648dff386555ec5537a21de9fc35 Reviewed-by: David Schulz <david.schulz@qt.io>
* TaskTree: Prepare for de-utils-ization - part 2Jarek Kobus2023-05-121-2/+2
| | | | | | | | | Move TaskTree into Tasking namespace. Move Tasking namespace out of Utils namespace. Change-Id: Ib4c1d7f54f1808517e54768dfa27209c33517b61 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io>
* ClangTools: Use FilePath in AnalyzeUnithjk2023-02-091-2/+2
| | | | | | Change-Id: Ic8e19053a60e7c4d801f32f9048b7c48d00b2a3d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* ClangTools: Fix incompatible class/struct forward-declarationsOrgad Shaneh2023-01-121-1/+1
| | | | | | | Amends 5dec97ea412. Change-Id: I87209ee35fd4f13654a34be57f5bb1e69c1b12b0 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* ClangTools: Reuse TaskTreeJarek Kobus2023-01-121-20/+4
| | | | | | | | | Reuse it in ClangToolRunControl and DocumentClangToolRunner. Get rid of ClangToolRunner and provide clangToolTask() method instead. Change-Id: I677940b325850849c5f5a60f2d320c031a4f0da0 Reviewed-by: David Schulz <david.schulz@qt.io>
* ClangToolRunner: Add done(const AnalyzeOutputData &) signalJarek Kobus2023-01-121-18/+4
| | | | | | | | | | | | | | | | | | | Introduce AnalyzerOutputData structure that is passed inside new done() signal. This signal replaces the finishedWithSuccess() and finishedWithFailure() signals. The output structure contains all the data required in clients' handlers. Move AnalyzeUnit into clangtoolrunner.h in order to avoid circular dependencies. Get rid of outputFilePath(), as it's passed inside AnalyzeOutputData now. Inline ClangToolRunWorker::unitsToAnalyze() as it's used only once. Change-Id: Icf9a52853c68e83f6ddfc4858dbcb830b96e1844 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* Make AnalyzeUnit a member of AnalyzeInputDataJarek Kobus2023-01-111-9/+3
| | | | | | | Get rid of run() arguments. Change-Id: I744da2a043136e579284eb2697b9b71f476b58a9 Reviewed-by: David Schulz <david.schulz@qt.io>
* ClangToolRunner: Flatten the class hierarchyJarek Kobus2023-01-111-1/+1
| | | | | | | | | Instead of creating subclasses of ClangToolRunner configure the base class according to the tool specifics. Change-Id: I51b611b2375571453c7f9690499d744582f035c1 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* Remove GPL-3.0+ from license identifiersKai Köhne2023-01-061-1/+1
| | | | | | | | | | | | | | | Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0, this applies only to a hypothetical newer version of GPL, that doesn't exist yet. If such a version emerges, we can still decide to relicense... While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only Change was done by running find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \; Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* ClangTools: Run clang-tidy and clazy separatelyChristian Kandeler2022-12-151-2/+4
| | | | | | | | | | | | | They are two different tools and should not have been merged into a single runner in the first place. People can now actively decide to run clazy if they really want to, rather than getting confronted with its increasingly irrelevant complaints by default. We keep the common settings widget for now. Change-Id: I3c2b1db8c07ff5c128700d4a1deefd710967568a Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@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>
* ClangToolRunWorker: Avoid using sender()Jarek Kobus2022-07-221-3/+4
| | | | | Change-Id: I299fa6464b77aed3852d3b5a7ce4817678d5f369 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Merge CppTools into CppEditorChristian Kandeler2021-09-011-6/+6
| | | | | | | | | | | | | | | | 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-2/+2
| | | | | | | | 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>
* CppTools: Turn some classes into pure value typesChristian Kandeler2021-08-131-2/+2
| | | | | | | | | | | | | 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>
* Fix implicit size_t -> int MSVC warningsOrgad Shaneh2020-11-111-1/+1
| | | | | Change-Id: I2f224c942c52a172788e917641420e8380c54859 Reviewed-by: hjk <hjk@qt.io>
* ClangTools: Add automatic clang tool runner for open documentsDavid Schulz2020-08-281-2/+3
| | | | | | | | Fixes: QTCREATORBUG-23349 Change-Id: I81197180c9d69c7df6184f8fcbf05f2256eaf7f6 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* clang: Fix include/resource dir confusionChristian Kandeler2020-08-241-1/+1
| | | | | | | | | | | The getClangResourceDirAndVersion() function in ClangTools could return the actual resource dir or the include dir, depending on the input. This mistake happened because of misleading names spread all around the code. Now the function returns what it says, and the other names are accurate as well. Change-Id: I0a8600857ee7b9fafb16256e0d1ad203ac3273d2 Reviewed-by: David Schulz <david.schulz@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>
* ClangTools: Use resource dir from tool instead of hard-coded oneNikolai Kosjar2020-06-191-1/+2
| | | | | | | | | | This makes it more likely that using other clang-tidy and clazy binaries than the ones shipped with Qt Creator will work. Done-with: Nikolai Kosjar Fixes: QTCREATORBUG-23672 Change-Id: I8c44e037ca8d50505fe10032034edaf4f408d52c Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* ClangTools: Print elapsed time on finishNikolai Kosjar2019-12-041-0/+3
| | | | | | | ...as this is useful to know for some bigger runs. Change-Id: Ib4cc68ea4a3bed21ac7e632213e92e26be03d978 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* ClangTools: Provide more information if plugin tests failNikolai Kosjar2019-12-041-3/+0
| | | | | | | | | | Print the error text we are showing in the info bar. For example: QWARN : ...testProject(simple.pro) Error: Failed to build the project. FAIL! : ...testProject(simple.pro) 'finishedSuccessfully' returned FALSE. () Change-Id: I7df91909dc4974a2c3aa9d44cb7511222517198c Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* ClangTools: Introduce an info barNikolai Kosjar2019-12-031-1/+10
| | | | | | | ...displaying status information and errors. Change-Id: I4f86b440b28e82786299700dee572e77de7334f3 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Clang/ClangTools: Separate custom diagnostic configsNikolai Kosjar2019-10-011-0/+1
| | | | | | | | | | | | | | | | | | Add a separate pool of custom diagnostic configs for the ClangTools plugin. That is, the diagnostic configs in Menu: Tools > C++ > Code Model are not shared anymore with the configs at Menu: Tools > Analyzer > ClangTools On plugin initialization of ClangTools, move tidy/clazy related configs to ClangTools. Change-Id: Id06087a58b53e466a3d7bbac669550c5fbe9899d Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ClangTools: Move run settings to projects modeNikolai Kosjar2019-09-271-6/+7
| | | | | | | | | | | | | | | | | Make the global run settings available per project in project mode and thus remove the diagnostic config selection from the selectable-files-dialog: * Extract the classes RunSettings and RunSettingsWidget instead of duplicating stuff. * Ensure to pick up the old settings * Add some convenience buttons/links in projects mode allowing to restore the global settings, to open the global settings and to navigate (back) to the analyzer mode. Change-Id: I1b91b6f8e58a87a025774e4643c46e176b2a8885 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ClangTools: Merge ClangTidyClazyRunControl into ClangToolsRunControlNikolai Kosjar2019-09-121-8/+7
| | | | | | Change-Id: I162bbb9374fda0bbfc7f3db8fa245f3b5d6e73ad Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ClangTools: Add action for running on current fileNikolai Kosjar2019-09-121-2/+3
| | | | | | | | | | | Ideally, we would build the particular file before running the analyzer, but not every project manager supports that. For now, skip building the project for this action. Change-Id: Ibc516c41dd0dbeb7b17b44c0ac35ae4b46ae801d Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ClangTools: Invoke clang-tidy instead of clangNikolai Kosjar2019-09-121-1/+0
| | | | | | Change-Id: Ibcc53cf8cb8bbaf262757bec52f15936506dad50 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ClangTools: Simplify a few signatureshjk2019-09-111-2/+0
| | | | | | | | A runWorker's project and target cannot change and are obtainable via the runControl. Change-Id: I9ce62e94a964dde9b29abf0d1f05eddcd4b87c14 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ClangTools: Rename *RunControls to *RunWorkershjk2019-09-111-4/+4
| | | | | | | That's what they are. Change-Id: Icc167e87678f5888090d737325ac0067e6b3ea92 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ClangTools: Generalize run control for multiple runnersNikolai Kosjar2019-09-051-6/+14
| | | | | | | No functional change at this point. Change-Id: I537f9d8c9eed0b48056918809358a0a179b42eaa Reviewed-by: David Schulz <david.schulz@qt.io>
* ClangTools: Fix showing diagnostics outside the project root dirNikolai Kosjar2019-07-101-0/+1
| | | | | | | | | | Accept diagnostics from files that are known to the project (Project::files()) instead of checking whether they are below the project root directory (Project::projectDirectory()). Fixes: QTCREATORBUG-22213 Change-Id: I2f96374d6de3f53b1bd42be875dfe44b25a55fb1 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* ProjectExplorer: Move RunControl related classes to separate file pairhjk2019-03-131-1/+1
| | | | | Change-Id: I5da56f80336673d595907abcc797f628be680cd5 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ClangTools: ModernizeAlessandro Portale2018-11-081-1/+1
| | | | | | | | | | modernize-use-nullptr modernize-use-override modernize-use-equals-default Change-Id: I14a840c6f2972f57763cdfd4bb4483df1ec261d4 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* Clang: Provide include directory only for libclangIvan Donchevskii2018-08-081-1/+1
| | | | | | | | | Only libclang has issues with the include directory search therefore undefining include folders makes sense only for libclang options builder. Change-Id: Ie3f62f5f3a89503e6e0ab59e18889e92425c3abc Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* ClangTools: Remove temporary dirsNikolai Kosjar2018-06-051-1/+2
| | | | | | | | | ...when a new run is triggered instead of on Qt Creator shutdown. There is no reason to keep them around for longer than needed. Change-Id: Ida7698843cc2f8822ffd662679cf5da2c4ece05c Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* ClangTools: Remove huge "log files" after we've read themIvan Donchevskii2018-06-051-1/+1
| | | | | | | | | Serialized diagnostics consume quite a lot of space. Remove these files after they are read by QtC. Change-Id: I4b257e44ee182484726ebd808069198443992016 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ClangTools: Prompt for files to analyzeNikolai Kosjar2018-05-111-2/+6
| | | | | | | | If the run button is clicked, the user is prompted to select the files for analysis. Change-Id: I21e4ee6b7c14392a8c1a901ac7aa1c9c16e30f0d Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* ClangTools: Add settings for build project dependencyIvan Donchevskii2018-05-081-10/+3
| | | | | | | | | | All Clang tools get support for running project build before themselves or skipping that step. Before this change static analyzer always ran it and ClangTidy+Clazy tool always skipped. Change-Id: Idb9fbc27f0589472abb0f9d207857eb79c0079fd Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ClangTools: Add tool that runs clang-tidy and clazyIvan Donchevskii2018-04-261-1/+1
| | | | | | | | ... over the whole project. Generate and read serialized files to get diagnostics. Change-Id: Iafc25fc70443107a040a995efc038aed35102bbf Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ClangTools: Split generic part from static analyzer toolIvan Donchevskii2018-04-131-0/+117
To reuse it for other clang-based tools. Change-Id: I6c0d8e9eee543fa08faf3bf93c9fac33e43c6820 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>