platformio / platformio/platformio-core
Allow to change Include paths for cppcheck
Open
@valeros is already working on this.
Since Aug 24, 2022.
help wanted
static analysis
- Dominant language
- Python
- Stars
- 9.5k
- Forks
- 905
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 2
Description
- Feature Request.
Configuration
Operating system:
PlatformIO Version (platformio --version):
PlatformIO Core, version 6.1.4
Description of problem
Lack of ability to exclude Includes from cppcheck analysis. Long analysis and a long output.
Related conversation.
Steps to Reproduce
- Create project which includes hal headers from within the repository.
- Setup cppcheck with misra check:
- Perform static analysis
platformio.exe check
Actual Results
Analysis that is slow and outputs thousands of MISRA violations
Component HIGH MEDIUM LOW
----------- ------ -------- -----
src 0 0 4
src\CMSIS 0 0 1173
src\Device 0 0 8279
Total 0 0 9456
Environment Tool Status Duration
------------------ -------- -------- ------------
genericSTM32F103C8 cppcheck PASSED 00:00:19.038
Expected Results
A quick analysis of user code only without entering hal headers
Component HIGH MEDIUM LOW
----------- ------ -------- -----
src 0 0 4
Total 0 0 4
Environment Tool Status Duration
------------------ -------- -------- ------------
genericSTM32F103C8 cppcheck PASSED 00:00:1.234
If problems with PlatformIO Build System:
The content of platformio.ini:
[env:genericSTM32F103C8]
platform = ststm32
board = genericSTM32F103C8
board_build.ldscript = src/Device/STM32F103XB_FLASH.ld
build_flags =
-Isrc/CMSIS/
-Isrc/Device
check_skip_packages = yes ;don't inlcude compiler package inludes
check_patterns =
src/*.c
src/*.h
check_flags =
cppcheck:--addon=misra --suppress=suppress.txt
Source file to reproduce issue:
Working example:
https://github.com/dzid26/pio-exclude-cppcheck.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.