summaryrefslogtreecommitdiff
path: root/src/plugins/clangtools
Commit message (Collapse)AuthorAgeFilesLines
* ClangTools: Fix using correct run settingsNikolai Kosjar2019-10-311-0/+1
| | | | | | Change-Id: Ibf545719bb67857c3ecaaedf2435caa15d592e03 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ClangTools: Fix state of the "Apply Fixits" buttonNikolai Kosjar2019-10-313-7/+9
| | | | | | | | | * Disable the button when (re-)running an analysis. * Ensure the button stays disabled when a file is saved. Change-Id: I1140dd3938de554ea83d33c5bb490be3468d7db0 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ClangTools: Fix uninitialized variableNikolai Kosjar2019-10-311-1/+1
| | | | | | Change-Id: I3d703aaea0fdb61cbfb7f681eda00ff14376f9f6 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ClangTools: Fix a bugprone-parent-virtual-callNikolai Kosjar2019-10-311-1/+1
| | | | | | | | | | clangtoolsdiagnosticview.cpp:286:16: warning: qualified name 'QObject::eventFilter' refers to a member overridden in subclass; did you mean 'QAbstractItemView'? Change-Id: Ifcff716b336324384d0164925b548f61cf460449 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Clang Tools: Fix UI textLeena Miettinen2019-10-281-2/+2
| | | | | Change-Id: Ib2f6f548bbd778e585385315174f5fecb60b7f5a Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ClangTools: Make file selection dialog searchable/filterableNikolai Kosjar2019-10-017-137/+271
| | | | | | | | | Allow filtering for open and edited documents. Add also search functionality (triggerable by e.g. Ctrl+F). Change-Id: Ib41400abfd3b81371afddd56b88ff1b9bf8b9bcd Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ClangTools: State diagnostic config on startNikolai Kosjar2019-10-011-1/+4
| | | | | | | | ...in application output pane. Change-Id: I3c630494b3e1283a2455d241cda048a89a02e9ab Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Clang/ClangTools: Separate custom diagnostic configsNikolai Kosjar2019-10-0119-60/+259
| | | | | | | | | | | | | | | | | | 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: Clean up plugin testsNikolai Kosjar2019-10-014-39/+38
| | | | | | | | | We can provide the run settings explicitly instead of writing to the settings. Change-Id: Ibb9ef0280c14315ff7ba72be75dfd04c50d84484 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ClangTools: Fix commentNikolai Kosjar2019-09-271-1/+1
| | | | | | Change-Id: Ibf530af9d60cce45957c7a0b9c5b4e9f82407086 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ClangTools: Merge ClangTidyClazyTool into ClangToolNikolai Kosjar2019-09-2712-680/+546
| | | | | | Change-Id: Ieb6c4994ddcff9339a9cfb25c82e23dd2d2e8912 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-2724-501/+623
| | | | | | | | | | | | | | | | | 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>
* ProjectExplorer: Store parts of active build config in runcontrolhjk2019-09-241-5/+1
| | | | | | | | ... on runcontrol creation to prevent later access. Adapt some users. There are more to come. Change-Id: I2a3fe5eea0ada4eff7d08b79a6f49694e6962c8a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ClangTools: Add missing ui file to pro fileDavid Schulz2019-09-131-0/+1
| | | | | Change-Id: I0c63048795f641f06b3212716fb93f9fc2c7bcc9 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* ClangTools: Fix saving files before analyzingNikolai Kosjar2019-09-121-10/+2
| | | | | | | | ...in current file mode. Change-Id: Iae2ca9dc0ba5325f485943deb7fd93b3e9b419fe Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ClangTools: Remove BasicSettingsWidgetNikolai Kosjar2019-09-1214-239/+36
| | | | | | | | | | | | | This removes the [ ] Build the project before Analysis from the run dialog as it seems unlikely that this option is useful per project. Change-Id: I65f2ae8d1e936883f27c360d5b7b518fd31cdf07 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ClangTools: Merge ClangTidyClazyRunControl into ClangToolsRunControlNikolai Kosjar2019-09-128-180/+66
| | | | | | Change-Id: I162bbb9374fda0bbfc7f3db8fa245f3b5d6e73ad Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ClangTools: Clean up ClangToolRunnerNikolai Kosjar2019-09-124-83/+69
| | | | | | Change-Id: Icf0b8910ed236e48cfa775983e181491e6e9b6b0 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-1212-30/+113
| | | | | | | | | | | 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: Add UI for specifying executablesNikolai Kosjar2019-09-1210-7/+273
| | | | | | | | | | | | 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>
* ClangTools: Rename ClangToolsBasicSettings -> BasicSettingsWidgetNikolai Kosjar2019-09-1210-36/+37
| | | | | | | | ...as it's a widget. Change-Id: If4f151e7b8ba8c8a6c2b5deb7cba34128a902e3e Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ClangTools: Rename ClangToolsConfigWidget -> SettingsWidgetNikolai Kosjar2019-09-127-25/+23
| | | | | | Change-Id: I37ee3435054b27fd9e990f2923e6246ecb9e631f Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ClangTools: Allow invoking clazy-standalone instead of clangNikolai Kosjar2019-09-123-2/+37
| | | | | | | | | | | | ...this is for testing and debugging purposes so far. Eventually, we want to switch to clazy-standalone. But as of now there is no released clazy version supporting the required "-export-fixes=" option. It's in clazy's master branch only. Change-Id: If09941dc387658bbc17646a9140f4ee8fad4d6b3 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* ClangTools: Invoke clang-tidy instead of clangNikolai Kosjar2019-09-1211-72/+90
| | | | | | Change-Id: Ibcc53cf8cb8bbaf262757bec52f15936506dad50 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ClangTools: Use separate runners for tidy and clazyNikolai Kosjar2019-09-126-12/+37
| | | | | | | | | | 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>
* ClangTools: Prepare for more ClangToolRunnersNikolai Kosjar2019-09-115-61/+64
| | | | | | Change-Id: I6bbdbff496c0604367896d279df1a197f8a041bd Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: hjk <hjk@qt.io>
* ClangTools: Simplify a few signatureshjk2019-09-115-32/+27
| | | | | | | | 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-115-40/+40
| | | | | | | That's what they are. Change-Id: Icc167e87678f5888090d737325ac0067e6b3ea92 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Remove unused QObject parent arguments on options pageshjk2019-09-111-3/+1
| | | | | | | | In the new plugin setup scheme they are data members of the plugin pimpl and never use the parent. Change-Id: I28fe150393e8159064dcfbd113ce0320af50fd58 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* ClangTools: Generalize run control for multiple runnersNikolai Kosjar2019-09-054-29/+57
| | | | | | | No functional change at this point. Change-Id: I537f9d8c9eed0b48056918809358a0a179b42eaa Reviewed-by: David Schulz <david.schulz@qt.io>
* ClangTools: Support loading exported diagnosticsNikolai Kosjar2019-09-038-2/+339
| | | | | | | | | | Add a new toolbar button to load diagnostics exported with $ clang-tidy -export-fixes=/path/to/file $ clazy-standalone -export-fixes=/path/to/file (master version) Change-Id: I8316fe0706a18222e68220ef4fbfdc7ae8d09804 Reviewed-by: David Schulz <david.schulz@qt.io>
* Import YAML-Parser yaml-cppNikolai Kosjar2019-08-305-3/+28
| | | | | | | | | | | | | | | | | | | | | Version: tags/yaml-cpp-0.6.2 License: MIT yaml-cpp requires c++11 and since yaml-cpp 0.6 there is no dependency on boost anymore. A YAML parser is needed for the ClangTools plugin to parse exported diagnostics from clang-tidy/clazy: $ clang-tidy -export-fixes=/tmp/tidy.yaml source.cpp The imported source is stripped of unneeded files as documented with src/libs/3rdparty/yaml-cpp/patches/0001-yaml-cpp-Strip-unneeded-sources.patch (generated with "git format-patch -D") Change-Id: Ib0a521b5aff4b1cd058eb480bfb99fde4b320dc7 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* ClangTools: Extract filtering in readSerializedDiagnostics()Nikolai Kosjar2019-08-273-10/+14
| | | | | Change-Id: I07a4339af72d1e232eb7fe152a6af133a6a94436 Reviewed-by: David Schulz <david.schulz@qt.io>
* Merge remote-tracking branch 'origin/4.10'Eike Ziller2019-08-261-1/+1
|\ | | | | | | Change-Id: I0d4655b195d0615719d5d391aa69e682f8c6f78f
| * ClangTools: Tests: Fix tidy checksNikolai Kosjar2019-08-231-1/+1
| | | | | | | | | | | | | | | | Explicitly remove any by default enabled checks (e.g. static analyzer) otherwise we get more diagnostics than expected. Change-Id: I53e63a10001be8027e880dac01000bdca4a8f920 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | Compile fix with recent Qt devhjk2019-07-291-3/+1
| | | | | | | | | | | | | | | | | | The reasoning in 1b4766e26c6b did not take into account that the scope of QT_NO_JAVA_STYLE_ITERATORS may change over time, as done with f70905448f6 in Qt base. Change-Id: Ib1966ff26c4d36d5f62e149d6b45baa4aecf825d Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | ClangTools: Sanitize parameter orderNikolai Kosjar2019-07-266-19/+19
| | | | | | | | | | | | | | | | | | The path to the serialized diagnostics log is the main parameter, so put it first. Change-Id: I8865aad302b0e5d3008dab606ab774167cebda3c Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* | ClangTools: Use Utils::FilePath in log readerNikolai Kosjar2019-07-253-13/+16
| | | | | | | | | | | | Change-Id: I3a16c2eb3ac26a0265ba24f2c6f2126c79c6c660 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | ClangTools: Add using for QList<Diagnostics>Nikolai Kosjar2019-07-2510-35/+38
| | | | | | | | | | | | Change-Id: Ie7978fc33386d083b786ad75b3b6700125b11fec Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | ClangTools: Remove unused membersNikolai Kosjar2019-07-256-50/+9
| | | | | | | | | | | | Change-Id: I0f54705d93f9c12472afcb9587d55f6b9e3740a2 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | Avoid warning on empty expressionshjk2019-07-231-2/+2
| | | | | | | | | | | | | | | | For some reason, Q_UNUSED includes already a semicolon, adding one on the user side creates an additional empty statement. Change-Id: I9c5e8fac381345a60792cb75e2938fd53958d3b0 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | Merge remote-tracking branch 'origin/4.10'Tim Jenssen2019-07-129-59/+73
|\ \ | |/ | | | | Change-Id: Iaf27911e4e9fb762c1a24c84c458462bafe95728
| * ClangTools: Fix showing diagnostics outside the project root dirNikolai Kosjar2019-07-107-20/+15
| | | | | | | | | | | | | | | | | | | | 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>
| * ClangTools: Sanitize ClangToolsUnitTestsNikolai Kosjar2019-07-102-39/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the currently failing tests ClangToolsUnitTests::testProject(simple.qbs) ClangToolsUnitTests::testProject(simple.pro) which produce more diagnostics now due to the upgrade to clang 8. Sanitize the test by specifying exactly the tidy/clazy checks we are interested in. This should avoid maintenance on clang upgraded (pulling in new checks that will fail the test). While at it, fix writing the settings for the tests, which worked by accident so far. Change-Id: If8bf5076ad7141faa93eced611334ac609f0cf92 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | Merge remote-tracking branch 'origin/4.10'Tim Jenssen2019-07-041-2/+2
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | Conflicts: qbs/modules/qtc/qtc.qbs qtcreator_ide_branding.pri src/libs/utils/synchronousprocess.cpp src/plugins/baremetal/iarewtoolchain.cpp src/plugins/cmakeprojectmanager/cmakeproject.cpp tests/unit/unittest/CMakeLists.txt Change-Id: I124ad492df403286751e175d27fe36487ddf6d07
| * More Utils::toSet/toListhjk2019-07-041-2/+2
| | | | | | | | | | | | | | ... and unrelated cosmetic changes. Change-Id: I591b17fd5289831e701b683f8fb47816efd1fa67 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Merge remote-tracking branch 'origin/4.10'Eike Ziller2019-06-286-2/+44
|\ \ | |/ | | | | | | | | | | | | Conflicts: CMakeLists.txt tests/unit/unittest/unittest.pro Change-Id: I64296ad31502d9b35012da129a28e9277e9fcf8e
| * ClangTools: Show hint when disabling "Build the project before analysis."Nikolai Kosjar2019-06-264-1/+31
| | | | | | | | | | | | | | | | | | Show also the same hint as a tooltip. Fixes: QTCREATORBUG-22382 Change-Id: If1b594994cea387d6727775ce4c28c21d51f2d86 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
| * ClangTools: Hint to "Build the project before starting" optionNikolai Kosjar2019-06-251-0/+10
| | | | | | | | | | | | | | | | | | ...if the analysis ends with errors. Task-number: QTCREATORBUG-22382 Change-Id: I59f99947e80f7f4d0e2cac4df2e00f68e385ee01 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
| * ClangTools: Make building before starting analysis defaultNikolai Kosjar2019-06-251-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | ...when switching to "Custom Settings" in Menu: Analyze > "Clang Tidy and Clazy...". Otherwise we might run into parse errors due not yet generated source files (e.g. "fatal error: 'ui_mainwindow.h' file not found"). Task-number: QTCREATORBUG-22382 Change-Id: I6f499fa8f8ab2fff08d19165e474d14305cfded5 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>