Skip to content

Commit 8e1ff10

Browse files
committed
Add Cppcheck
1 parent e45fa7b commit 8e1ff10

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

.github/workflows/cppcheck.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Cppcheck
2+
3+
on:
4+
push
5+
6+
jobs:
7+
check:
8+
9+
runs-on: windows-latest
10+
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v5
14+
- name: Install Cppcheck
15+
run: winget install --id Cppcheck.Cppcheck --disable-interactivity --accept-source-agreements
16+
- name: Run Cppcheck
17+
run: |
18+
# overwrite PATH as there is a broken cppcheck in C:\Strawberry\c\bin\
19+
$env:Path = "C:\Program Files\Cppcheck\"
20+
$config = @"
21+
<?xml version="1.0"?>
22+
<def>
23+
<define name="CoCreatableClass(className)" value="" />
24+
</def>
25+
"@
26+
Set-Content -Path "config.cfg" -Value $config
27+
cppcheck --check-level=exhaustive --error-exitcode=-1 --enable=all --suppress=missingIncludeSystem --suppress=unusedFunction --quiet --project=${{ github.workspace }}\IExplorerCommand_CppWinRT\IExplorerCommand_CppWinRT.vcxproj
28+
cppcheck --check-level=exhaustive --error-exitcode=-1 --library=config.cfg --enable=all --suppress=missingIncludeSystem --suppress=unusedFunction --quiet --project=${{ github.workspace }}\IExplorerCommand_WRL\IExplorerCommand_WRL.vcxproj

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Examples of implementing IExplorerCommand Windows File Explorer context menu she
1010

1111
## GitHub Actions status
1212

13-
[![Build](https://github.com/cjee21/IExplorerCommand-Examples/actions/workflows/build.yml/badge.svg)](https://github.com/cjee21/IExplorerCommand-Examples/actions/workflows/build.yml)
13+
[![Build](https://github.com/cjee21/IExplorerCommand-Examples/actions/workflows/build.yml/badge.svg)](https://github.com/cjee21/IExplorerCommand-Examples/actions/workflows/build.yml) [![Cppcheck](https://github.com/cjee21/IExplorerCommand-Examples/actions/workflows/cppcheck.yml/badge.svg)](https://github.com/cjee21/IExplorerCommand-Examples/actions/workflows/cppcheck.yml)
1414

1515
## Other examples
1616

0 commit comments

Comments
 (0)