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`
`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.
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.
`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.
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.
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.
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.
This starts to untangle the `ErrorLogger` implementation in
`CppcheckExecutor` which handles three different cases and makes things
unnecessarily complicated.
* added `Settings::useSingleJob()` and use it instead of checking `jobs` or `jointSuppressionReport`
* extracted single job execution into `SingleExecutor`
* moved `reportStatus()` from `CppCheckExecutor` to Èxecutor
* TestSingleExecutor: improved tests
* added testing of markup extension handling in executors
* cleaned up includes based on `include-what-you-use`
* testsingleexecutor.cpp: suppress `performance-unnecessary-value-param` clang-tidy warnings
* ProcessExecutor: send color via pipe instead of applying it beforehand
* do not unconditionally apply colors to output / disable all colors in tests / adjusted tests for changed output behavior
* fixed precision loss in `Executor::reportStatus()`
* fixed `naming-varname` selfcheck warnings