Commit Graph

41 Commits

Author SHA1 Message Date
David Schulz
8b16e40858 ClangTools: Utilize TaskTree to parse diagnostics from file
This reduces the time the main thread is blocked for reading the diagnostics
from the result file.

Change-Id: If6cc5671c709cb519b651c2b7ce3e8067e0b5f39
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-06-19 08:38:06 +00:00
Jarek Kobus
d97d3f58ac TaskTree: Rename TaskItem into GroupItem
Not all classes derived from TaskItem are tasks,
but the common denominator is that all may be placed
inside a group: thus GroupItem sounds more appropriate.

Addresses the 10th point in the bugreport below.

Task-number: QTCREATORBUG-28741
Change-Id: I94d728a8e39ec732810f2e5bbe6b9a76f3bc387c
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2023-06-06 09:06:01 +00:00
Jarek Kobus
97a66067bb TaskTree: Prepare for de-utils-ization - part 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>
2023-05-12 08:09:19 +00:00
Christian Kandeler
4028777743 ClangTools: Prefer .clang-tidy file by default
... and move this setting outside the diagnostic config.

Fixes: QTCREATORBUG-28852
Change-Id: Ie3b19ba7bec2bc96451f3216fa06a6941cad4c94
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-04-13 11:52:04 +00:00
hjk
da7383387d Clangtools: More FilePath
Change-Id: I82057f1a9788043ee45a268ae57847caf6c994f3
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-02-09 10:00:45 +00:00
hjk
9ad60cd891 ClangTools: Use FilePath in AnalyzeUnit
Change-Id: Ic8e19053a60e7c4d801f32f9048b7c48d00b2a3d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-02-09 09:57:24 +00:00
Jarek Kobus
6415eef6af DiagnosticMark: Replace source field with ClangToolType
Replace also the AnalyzeOutputData::toolName field with
ClangToolType toolType. Stop relying on comparing translatable
strings inside DocumentClangToolRunner::onDone().

Change-Id: I1b69619fe9283622ed478973ee3a5e9cf8f4c309
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-01-12 10:12:52 +00:00
Jarek Kobus
e7781e2a99 ClangTools: Reuse TaskTree
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>
2023-01-12 10:11:44 +00:00
Jarek Kobus
a9c675d88d ClangToolRunWorker: Move logging of started tools into runner creator
Runner creator is being called just before it's about to be run.
Get rid of unneeded ClangToolRunner::fileToAnalyze() now.

Change-Id: I51e49597f38919a7174495df3db6b2adc5109a21
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-01-12 09:24:56 +00:00
Jarek Kobus
64b9728a68 ClangToolsUtils: Add isVFSOverlaySupported()
Remove ClangToolRunner::supportsVFSOverlay().
Move check for modified document and vfsOverlay into
runner creator method, as it's called in the same cycle just
before the runner is about to be started.

Change-Id: I7a5df71bfa73c350862e4c7f9eae49773b6206b7
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-01-12 09:24:50 +00:00
Jarek Kobus
5dec97ea41 ClangToolRunner: Add done(const AnalyzeOutputData &) signal
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>
2023-01-12 09:24:43 +00:00
Jarek Kobus
60b23dca75 ClangToolRunner: Remove unused executable()
Change-Id: I4e426db949ce64674c8e9e1954e621661002179a
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-01-12 09:24:24 +00:00
Jarek Kobus
c350c87e9e ClangToolRunner: Get rid of ArgsCreator
Now we have all the data available so there is not need
to postpone the creation of arguments.

Change-Id: Iec10f5715d6f572c9a8fde63c8c6d3f96f894b47
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-01-12 09:24:18 +00:00
Jarek Kobus
711584bb3c Make AnalyzeUnit a member of AnalyzeInputData
Get rid of run() arguments.

Change-Id: I744da2a043136e579284eb2697b9b71f476b58a9
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-01-11 10:16:04 +00:00
Jarek Kobus
017ceef3b0 ClangToolRunner: Make overlayFilePath a member of AnalyzeInputData
Get rid of setVFSOverlay().

Change-Id: I0f406994f78523c40a5d2f2262f25c9b2c5a5442
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-01-11 09:15:38 +00:00
Jarek Kobus
c7b60e7d6b ClangToolRunner: Flatten the class hierarchy
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>
2023-01-11 09:15:28 +00:00
Jarek Kobus
0c1077425f ClangToolRunner: Move some methods into protected section
As they are used only from subclasses.

Change-Id: Ic16ffe3af8417b74af8a0ad3ea7ed1219f1f3a01
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-01-09 12:14:35 +00:00
Jarek Kobus
bf864ff371 ClangTools: Get rid of OutputFileFormat enum
This enum contains only one value now, so it's no-op.

Amends 9fc2fda07e

Change-Id: Ifa144dafb6155db93c06e3faecc40e38e464dac0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2023-01-09 12:14:28 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
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>
2023-01-06 11:15:13 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
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>
2022-08-26 12:27:18 +00:00
hjk
189fe7fab3 ClangTools: Simplify process rampdown
This is now taken care of in the desctuctor of QtcProcess itself.

Change-Id: I51e65344e6d2cae4498e292e4ad6a586c68b0539
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-06-16 11:20:56 +00:00
Jarek Kobus
3649176402 ClangToolRunner: Connect to QtcProcess::done() signal
Instead of connecting to errorOccurred() and finished() signals.

Change-Id: Ie15a25000a647d4046b59e9ebeb44c32bc29b53b
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-04-14 12:30:44 +00:00
Jarek Kobus
8e0ae8ba96 QtcProcess: Limit the inclusion of qtcprocess.h
Move the rest of QtcProcess enums to processenums.h.
Move ExitCodeInterpreter into processenums.h.
Remove superfluous Utils:: prefix.

Change-Id: Iaa596f353d33d6930085a621b114cc15a35caa80
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-02 13:30:39 +00:00
hjk
f29bc8c787 ClangTools: Proliferate use of FilePath
Change-Id: I3eb16546a729ab01c10e37572adac9aef83f5cd4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-18 11:43:30 +00:00
hjk
9a82846de4 ClangTools: Use FilePath in ClangToolRunner::init()
One .path().path() less.

Change-Id: Ibf1b25acefafc1bb5359d839ebf272c3d1fb08d6
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-07-05 06:06:45 +00:00
hjk
0b7e71ddca ClangTools: Don't double-buffer in ClangToolRunner
Not needed, and the only user of QtcProcess::readyRead.

Change-Id: I6ba071507f545076cf74660c20916407c3f3a551
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-14 05:46:16 +00:00
hjk
196b7b0f24 ClangTools: Use Utils::CommandLine for a command line
Change-Id: I489e5538fe97e7d565eed22af8d285d89b870ca3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-04 04:38:17 +00:00
hjk
84fbb9f605 ClangTools: Remove some use of SynchronousProcess
Change-Id: Ifaf8979f5e3d2799002322580c8cb6982c099921
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-05-03 12:32:07 +00:00
hjk
57f5fbbf57 ClangTools: Do not try to kill subprocesses syncronously
Task-number: QTCREATORBUG-24627
Change-Id: Iec0169335d62435c017e39f252be3d7ca470d2d4
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-09-11 11:31:01 +00:00
David Schulz
7bbbdeac52 ClangTools: use VFSoverlay if the clang tool supports it
check the help output of a clang tool whether virtual file
system overlay is supported. Prepares for the vfso support
of clazy-standalone.

Change-Id: I157c94de1dda41c83945c9bc8a4c2e132b2e6551
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-09-04 09:48:44 +00:00
David Schulz
e176958da1 ClangTools: Add automatic clang tool runner for open documents
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>
2020-08-28 07:20:32 +00:00
Nikolai Kosjar
342679292c ClangTools: Clean up ClangToolRunner
Change-Id: Icf0b8910ed236e48cfa775983e181491e6e9b6b0
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-09-12 13:36:01 +00:00
Nikolai Kosjar
fc37ea4276 ClangTools: Add UI for specifying executables
Add a new group box "Executables" for this. Hide the UI for
clazy-standalone unless QTC_USE_CLAZY_STANDALONE_PATH is set as there is
no released version with the needed -export-fixes option.

Rename the previous group box from "General" to "Run Options".

Change-Id: Ia9daf66c40d3a7eea98b31d9c086886d29466490
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-09-12 13:35:01 +00:00
Nikolai Kosjar
a8f00d147c ClangTools: Invoke clang-tidy instead of clang
Change-Id: Ibcc53cf8cb8bbaf262757bec52f15936506dad50
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-09-12 10:24:30 +00:00
Nikolai Kosjar
9f868c44ce ClangTools: Use separate runners for tidy and clazy
For a file to analyze, start one process for tidy and one for clazy.

No functional change.

Change-Id: I049faed5ddbe306e4690ec6831fad19de0de35f6
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-09-12 10:23:50 +00:00
Nikolai Kosjar
217332a48f ClangTools: Prepare for more ClangToolRunners
Change-Id: I6bbdbff496c0604367896d279df1a197f8a041bd
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2019-09-11 08:47:07 +00:00
Alessandro Portale
c4b07bf730 ClangTools: Modernize
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>
2018-11-08 11:40:57 +00:00
Nikolai Kosjar
bb6c02a443 ClangTools: Remove dead code
Change-Id: I5db111402902e81099489dc5ab4b0b929c574969
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-06-05 10:36:21 +00:00
Ivan Donchevskii
87678e9a07 ClangTools: Remove huge "log files" after we've read them
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>
2018-06-05 09:00:08 +00:00
Ivan Donchevskii
219e23332e ClangTools: Add tool that runs clang-tidy and clazy
... over the whole project.
Generate and read serialized files to get diagnostics.

Change-Id: Iafc25fc70443107a040a995efc038aed35102bbf
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-04-26 13:02:19 +00:00
Ivan Donchevskii
e9c462391e ClangTools: Split generic part from static analyzer tool
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>
2018-04-13 12:34:53 +00:00