Commit Graph

1192 Commits

Author SHA1 Message Date
Daniel Marjamäki 948f822943
2.13: Update copyright year [ci skip] (#5785) 2023-12-20 21:41:58 +01:00
Daniel Marjamäki 49da3e3821
Fixed #12281 (IDE plugin integration is broken by checkers report) (#5779) 2023-12-19 15:55:29 +01:00
Daniel Marjamäki 5aa1710dd0
Fix #12071 (Add safety mode that makes cppcheck more strict about critical errors) (#5777) 2023-12-18 18:26:23 +01:00
Oliver Stöneberg aa7629d969
aligned and optimized unique error handling (#5280)
The handling in `CppCheck::reportErr()` and `Executor::hasToLog()` was
slightly different. I hope this can somehow be shared after the executor
reworking.

We were also using a very inappropriate container for the error list
which caused a lot of overhead.

`-D__GNUC__ --debug-warnings --template=daca2 --check-library -j2
../test/testsymboldatabase.cpp`

Clang 15
main process  `284,218,587` -> `175,691,241`
worker process `9,123,697,183` -> `8,951,903,360`
2023-12-17 21:59:06 +01:00
Daniel Marjamäki 2932ab7592
Revert "Fixed #12071 (suppressing critical error, no indication to user that analysis of file fails) (#5771)" (#5775)
This reverts commit 7c316fb76d.
2023-12-17 19:13:14 +01:00
Daniel Marjamäki 7c316fb76d
Fixed #12071 (suppressing critical error, no indication to user that analysis of file fails) (#5771) 2023-12-17 15:42:17 +01:00
Oliver Stöneberg f2622a673f
more cleanups in handling of ignored files (#5767) 2023-12-16 21:04:45 +01:00
olabetskyi 7191ed92b9
#12263: Constant Error 'missingInclude' (#5769)
Small adjustment of the log of the error.

- printed only when there was `--enabled=information` and no mentioning
of `missingInclude`
2023-12-16 18:38:30 +01:00
Oliver Stöneberg fcb41e2533
small cleanup of handling of ignored paths (#5757) 2023-12-14 16:55:42 +01:00
Daniel Marjamäki bc5023775d
Partial fix for #12254 (cppcheck.cfg can't be loaded from relative paths anymore) (#5760) 2023-12-13 06:53:03 +01:00
Oliver Stöneberg 7452e681dd
fixed #12221 - de-duplicate input source files (regression) (#5740) 2023-12-08 22:17:22 +01:00
Oliver Stöneberg 3272a2bbe7
greatly improved `Settings::loadCppcheckCfg()` error handling (#5712)
This also fixes the issue that `cppcheck.cfg` is no longer being loaded
from executable path. That was introduced by #5704.
2023-12-01 16:34:14 +01:00
Oliver Stöneberg 237bed8a91
CmdLineParser: made some options exclusive (#5704) 2023-12-01 14:19:47 +01:00
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