Hi,
I want exclude .pio library from Cppcheck but neither check_patterns
nor pio check --pattern
works.
My Ploatformio.ini
[env:desktop]
platform = native
build_flags = -std=gnu++11 -Iinclude -Ilib -DDEBUG -DUNIT_TEST
test_build_project_src = yes
test_transport = custom
test_ignore = test_embedded
lib_deps =
fabiobatsilva/ArduinoFake@^0.2.2
noah1510/Native SPI@^0.1.0
check_tool = cppcheck
check_flags = --enable=all
cppcheck: --addon=misra.json
check_severity = medium, high
check_patterns = src/*.*
Can you give a minimal code examoke too that shows in which way exactly it’s not working?
Yes, instead of excluding .pio directory, it check the content of .pio directory.
.pio/libdeps/desktop/ArduinoFake/src/arduino/Stream.h:64: [medium:warning] Member variable ‘Stream::startMillis’ is not initialized in the constructor. [uninitMemberVar]
.pio/libdeps/desktop/ArduinoFake/src/arduino/USBAPI.h:89: [medium:warning] Member variable 'Serial::rx_buffer_head’ is not initialized in the constructor. [uninitMemberVar]
.pio/libdeps/desktop/ArduinoFake/src/arduino/USBAPI.h:89: [medium:warning] Member variable 'Serial::rx_buffer_tail’ is not initialized in the constructor. [uninitMemberVar]
.pio/libdeps/desktop/ArduinoFake/src/arduino/USBAPI.h:89: [medium:warning] Member variable 'Serial::_rx_buffer’ is not initialized in the constructor. [uninitMemberVar]
.pio/libdeps/desktop/ArduinoFake/src/fakeit/fakeit.hpp:7533: [medium:warning] Class ‘Implementation’ does not have a copy constructor which is recommended since it has dynamic memory/resource allocation(s). [noCopyConstructor]
.pio/libdeps/desktop/ArduinoFake/src/fakeit/fakeit.hpp:7533: [medium:warning] Class ‘Implementation’ does not have a operator= which is recommended since it has dynamic memory/resource allocation(s). [noOperatorEq]
.pio/libdeps/desktop/ArduinoFake/src/fakeit/fakeit.hpp:8313: [medium:warning] Value of pointer ‘reference’, which points to allocated memory, is copied in copy constructor instead of allocating new memory. [copyCtorPointerCopying]
Error: Failed to execute check command! Exited with code -6.
Error: cppcheck failed to perform check! Please examine tool output in verbose mode.
========================================================================== [FAILED] Took 22.30 seconds ==========================================================================
Component HIGH MEDIUM LOW
.pio/libdeps/desktop/ArduinoFake/src/arduino 0 4 0
.pio/libdeps/desktop/ArduinoFake/src/fakeit 1 13 0
Total 1 17 0
Environment Tool Status Duration
embedded cppcheck IGNORED
desktop cppcheck FAILED 00:00:22.303
===================================================================== 1 failed, 0 succeeded in 00:00:22.303 =====================================================================
The terminal process “pio ‘check’, ‘–environment’, ‘desktop’” terminated with exit code: 1.