-
Notifications
You must be signed in to change notification settings - Fork 192
74 lines (68 loc) · 2.89 KB
/
cppcheck.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: cppcheck
on:
push:
branches: [ master ]
pull_request:
branches: [ master, develop ]
jobs:
build:
runs-on: ubuntu-20.04
# That container is too old to work with the actions that are on node20 now...
#container:
# image: nrel/cppcheck:2.3
steps:
- uses: actions/checkout@v4
- name: Install cppcheck
shell: bash
run: |
# I made a PPA on launchpad where I built cppcheck 2.3 for focal
sudo add-apt-repository ppa:jmarrec/ppa
sudo apt update
sudo apt install -y cppcheck
cppcheck --version
- name: Run cppcheck
shell: bash
run: |
# We ignore polypartition and nano since these are third party libraries
cppcheck \
--std=c++20 \
--enable=warning,style,information \
--suppress=toomanyconfigs \
--suppress=noExplicitConstructor \
--suppress=useStlAlgorithm \
--suppress=unmatchedSuppression \
--suppress=unusedPrivateFunction \
--suppress=functionStatic:src/utilities/core/EnumBase.hpp \
--suppress=functionStatic:src/utilities/core/StaticInitializer.hpp \
--suppress=functionStatic:src/utilities/units/QuantityFactory.hpp \
--suppress=functionConst:src/utilities/filetypes/CSVFile.hpp \
--suppress=functionConst:src/utilities/filetypes/RunOptions.hpp \
--suppress=functionConst:src/utilities/filetypes/WorkflowJSON.hpp \
--suppress=functionConst:src/utilities/filetypes/WorkflowStep.hpp \
--suppress=functionConst:src/utilities/filetypes/WorkflowStepResult.hpp \
--suppress=redundantAssignment:src/utilities/sql/SqlFile.hpp \
--suppress=constParameterCallback:src/utilities/idd/benchmark/IddObjectParse_Benchmark.cpp \
--suppress=constParameterCallback:src/utilities/idd/benchmark/LoadIdd_Benchmark.cpp \
--suppress=constParameterCallback:src/utilities/idf/benchmark/IdfObjectParse_Benchmark.cpp \
--suppress=constParameterCallback:src/utilities/idf/benchmark/LoadIdfFile_Benchmark.cpp \
--suppress=constStatement:src/utilities/geometry/Intersection.cpp \
--inline-suppr \
--inconclusive \
--template='[{file}:{line}]:({severity}),[{id}],{message}' \
-j $(nproc) \
--max-configs=1 \
-i src/cli/test \
-i src/airflow/contam \
-i src/polypartition \
-i src/nano \
./src \
3>&1 1>&2 2>&3 | tee cppcheck.txt
- name: Parse and colorize cppcheck
shell: bash
run: python ./ci/colorize_cppcheck_results.py
- name: Upload cppcheck results as artifact
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: OpenStudio-${{ github.sha }}-cppcheck_results.txt
path: cppcheck.txt