Commit Graph

1179 Commits

Author SHA1 Message Date
Oliver Stöneberg a937862a5d
CmdLineParser: return enum from `parseFromArgs()` instead of using additional member (#5698) 2023-11-27 12:06:03 +01:00
Oliver Stöneberg f2461781fd
added `xml.h` wrapper for TinyXML2 / cleaned up suppressions of Clang compiler warnings (#5700) 2023-11-26 14:04:35 +01:00
Oliver Stöneberg 1d3f9beb21
CppCheckExecutor: do not modify settings after they were passed to `CppCheck` (#5697) 2023-11-25 22:07:49 +01:00
Oliver Stöneberg 8e1ae7e412
CmdLineParser: various refactorings and cleanups as well as testing improvements (#5676) 2023-11-25 21:12:24 +01:00
Oliver Stöneberg 4addad1643
moved settings-related code from `CppCheckExecutor` to `CmdLineParser` (#5672)
`CppCheckExecutor` contains some code which is not related to the
execution but actually to the creation of the settings. This is causing
inconsistencies in the error handling/logging as well as interfering
with the testability.
2023-11-19 19:45:10 +01:00
Oliver Stöneberg e47300016b
moved some classes/structs into anonymous namespace (#5669) 2023-11-16 15:49:41 +01:00
Oliver Stöneberg 8b69ccadd4
CppCheckExecutor: extracted logging instance related code into separate implementation class (#5658) 2023-11-16 10:35:43 +01:00
Oliver Stöneberg 9228b9e424
iwyu.yml: fixed `include-what-you-use` job / cleaned up includes (#5657)
As usual when the base clang version of a distro changes iwyu ends up
broken and needs additional packages and/or options applied to work
again.
2023-11-13 23:24:06 +01:00
Oliver Stöneberg b0cde34d1a
refs #12167 - moved ordering of markup files into shared code / removed related test cases from executor tests (#5642)
This is not completely fixing the issue yet. `test-qml.py` still fails
when using multiple threads.
2023-11-09 10:17:30 +01:00
Oliver Stöneberg 2a15428096
fixed #12059 - added `--fsigned-char` and `--funsigned-char` command-line options (#5580) 2023-11-08 09:28:33 +01:00
Oliver Stöneberg bc174c502a
fixed #12145 - provided order of source files is not preserved (#5625) 2023-11-07 21:21:24 +01:00
Oliver Stöneberg 704b862a2d
cleaned up the file filtering code and improved testing of it (#5622) 2023-11-06 19:06:22 +01:00
Oliver Stöneberg df860a937d
do not explicitly load `windows.cfg` during command-line parsing (#5613)
As we now fail early on loading of all libraries we no longer need to
explicitly bail out on mandatory ones. This would have also caused
`libraries` and `library` to go out-of-sync and possibly lead to
duplicated loading of the library. It also allows for a
`CppCheckExecutor` to be made private.
2023-11-04 13:33:10 +01:00
Oliver Stöneberg ca6d1aafdb
moved `fileSettings` out of `Settings` (#5608)
Moved the `FileSettings` out of the `Settings` and pass them around
explicitly. They can never be specified at the same time and are used
exclusively. The code hasn't been fully adjusted to reflect this as this
is only the refactoring without any functional changes.
2023-11-03 23:24:04 +01:00
Oliver Stöneberg 63e00ea918
fixed some "Variable can be made constexpr" Rider warnings (#5615) 2023-11-03 09:55:44 +01:00
Oliver Stöneberg e6d15b17ff
extracted `FileSettings` from `ImportProject` to `filesettings.h` (#5604) 2023-11-02 17:42:41 +01:00
Oliver Stöneberg 8d5fa19caa
filelister.cpp: removed unused `NAME_MAX` related code (#5609)
The code which was using this was removed in
8b309a8829.
2023-11-02 10:04:53 +01:00
Oliver Stöneberg dd627a2b1d
moved `ImportProject` out of `Settings` and only store `fileSettings` (#5603)
`ImportProject` is not needed outside of the command-line parsing so we
do not need it inside the `Settings` at all. We only use the
`fileSettings` in the executors.
2023-11-01 21:08:30 +01:00
chrchr-github bbaa7be901
Fix #12118 FP passedByValue for callbacks (#5591) 2023-10-31 12:06:31 +01:00
Oliver Stöneberg 7086ffaa1b
fixed #12045 - print error when using an option which has not been compiled in instead of treating it as non-existent or a no-op (#5508)
Also disabled more internal code around those options and did some
cleanups.
2023-10-21 09:12:59 +02:00
Oliver Stöneberg 85fe627c68
fixed some typos (#5562) 2023-10-17 18:32:07 +02:00
Daniel Marjamäki dd76504f82
Fixed #3537 (Allow inline suppression comments for macros) (#5559) 2023-10-16 19:43:15 +02:00
Oliver Stöneberg 3811d01498
fixed "Redundant dereferencing and tasking address expression" Rider warnings (#5563) 2023-10-16 14:09:03 +02:00
Oliver Stöneberg 5e89eb05a6
iwyu.yml: made `include-what-you-use` output more verbose / cleaned up includes (#5540) 2023-10-16 12:57:49 +02:00
Oliver Stöneberg ebb877adcc
gui/platforms.h: renamed `Platform` to `PlatformData` / Platform: removed unnecessary `cppcheck` namespace (#5545) 2023-10-13 16:02:04 +02:00
Oliver Stöneberg 8c0d43d928
removed unnecessary encapsulation of severity enum and made it an `enum class` (#5541) 2023-10-12 11:58:39 +02:00
Oliver Stöneberg 7393083d5d
added `CmdLineLogger::printRaw()` / CppCheckExecutor: more `CmdLineLogger` usage (#5537) 2023-10-09 22:22:39 +02:00
Oliver Stöneberg cc92b09ec1
fixed #12016 - ProcessExecutor: added missing invocation of clang-tidy (#5529)
No changes in tests since the intercepted invocation function in called
in a forked process. The clang-tidy integration is also broken.
2023-10-09 12:26:58 +02:00
Oliver Stöneberg 06b5ef1e4d
cleaned up includes based on include-what-you-use (#5532) 2023-10-09 10:07:20 +02:00
Oliver Stöneberg 0f28f3e493
generate `AddonInfo` only once (#4958)
Currently the `AddonInfo` is generated and discarded on each addon
invocation. This leads to an unnecessary process invocation for each
addon on each file.

Also if an addon is completely broken we will still perform the whole
analysis only for it to be failed at the end so we should bail out early
if we know it doesn't work at all.
2023-10-08 21:28:57 +02:00
Oliver Stöneberg a22c181553
fixed "Redundant elaborated type specifier" Rider warnings (#5517) 2023-10-08 09:10:17 +02:00
Oliver Stöneberg 3ba53c6b6a
fixed #12022 - disallow using `--project` with source files (#5515) 2023-10-08 09:07:15 +02:00
Oliver Stöneberg 8dee551cad
added testing of clang-tidy invocation to executor tests / also some cleanups (#5514) 2023-10-08 09:06:02 +02:00
Oliver Stöneberg 5a52fa80fb
refs #12022 - disallow multiple `--project` options (#5499) 2023-10-05 21:36:44 +02:00
Oliver Stöneberg fc700b68eb
refs #4452 / refs #11705 - improved `--showtime=` behavior and testing (#4876)
This is a step onto leveraging the `ThreadExecutor` implementation for
`ProcessExecutor` which is a follow-up to #4870. We need to have the
proper test coverage and the existing implementations working as
expected before we move to the shared code.

Fixes:
- added `--showtime=` tests for all executor implementations
- only print `--showtime=summary` once at the end
- prevents `--showtime=` by multiple threads to be written at the same
time - essentially breaking the output
- reset the timer results before each test
- deprecated `top5` in favor of `top5_file`
- fixed printing for all executors except `ProcessExecutor`
2023-10-05 19:04:06 +02:00
chrchr-github 033cf64961
Avoid const_cast (#5490) 2023-09-28 18:20:43 +02:00
Oliver Stöneberg 3fd00c19df
perform logging in `CmdLineParser` through an interface (#5478)
This is in preparation of avoiding accessing `std::cout` directly as
well as streamlining and improving the logging during the settings
parsing. There are no functional changes yet.
2023-09-25 13:43:18 +02:00
Oliver Stöneberg f49fedb2ad
fixed #11483 (FN unusedFunction for method with inline implementation) (#5457)
Co-authored-by: chrchr-github <78114321+chrchr-github@users.noreply.github.com>
2023-09-20 14:45:44 +02:00
Oliver Stöneberg a43b55a0ca
Improved addon execution errorhandling (#5451) 2023-09-20 10:40:57 +02:00
Daniel Marjamäki 3089fc393b
Fix #12002 (Filelister: Unclear error 'finding files failed (error: 3)') (#5460) 2023-09-19 15:36:34 +02:00
Daniel Marjamäki 79e8735d1a
cli: update --help output, premium has full cert c++ coverage (#5450) 2023-09-14 15:59:06 +02:00
Oliver Stöneberg 98ce46a3e5
fixed #11919 - Removed deprecated command-line options `--template <template>` and `--template-format=<template>` (#5439) 2023-09-12 22:46:40 +02:00
Oliver Stöneberg 64cd09ab62
fixed #11917 (Default to `native` platform in Windows builds) (#5428) 2023-09-11 11:08:23 +02:00
Daniel Marjamäki 4fa1c7d5f9
2.12.99: Set versions (#5427) 2023-09-10 18:43:00 +02:00
Oliver Stöneberg 91070ca794
utils.h: added `startsWith()` and started using it (#5381)
This makes the code much more readable. It also makes it less prone to
errors because we do not need to specify the length of the string to
match and the returnvalue is clear.

The code with the bad returnvalue check was never executed and I added a
test to show that.
2023-09-08 19:30:25 +02:00
Daniel Marjamäki 4739ac8416 Update copyright year 2023-09-06 15:51:05 +02:00
Oliver Stöneberg ce780177b2
fixed #11910 - removed Visual Studio x86 targets from project files and builds from CI (#5397)
Windows XP Pro x64 was released on April 25, 2005 and consumer
processors supporting x86-64 have been around almost as long. Although
there are still 32-bit Windows images available there is not much of a
point maintaining support for these. We also never did any x86 builds
for non-Windows platforms in CI so we don't even know if we work on
those. You might still be able to build 32-bit binaries via CMake.
2023-09-04 19:40:13 +02:00
Daniel Marjamäki 44c149e51b
Fix #11897 (Safety: show what checks are enabled/disabled) (#5378)
This primarily adds the corresponding report in the GUI that we have in
the command line already
2023-08-31 18:28:47 +02:00
Oliver Stöneberg ad1caa8100
report `internalError` when command execution returns errorcode / also some related cleanups and tests (#5037)
Encountered while investigating https://trac.cppcheck.net/ticket/11708.

This has been like this since the introduction of `internalError` in
b6bcdf2936 (almost ten years ago to the
day). Logging internal errors which bail out(!) of the analysis simply
to `std::cout` for them possibly never to be seen (and also not affected
the exitcode) is pretty bad IMO. They should always be visible.

I also removed the filename from the message as it is already available
(and thus redundant) and its existence should be defined by the
template.
2023-08-31 13:33:29 +02:00
Daniel Marjamäki 276f017fbe
Partial fix for #11897 (Safety: show what checks are enabled/disabled) (#5372)
Example output on stdout:
```
$ ./cppcheck m1.cpp 
Checking m1.cpp ...
Active checkers: 59/177
```
2023-08-29 12:00:52 +02:00