Skip to content

Commit 7f95046

Browse files
committed
optimized supressions
1 parent f891d06 commit 7f95046

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

.github/codeql/codeql-config.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: "Custom CodeQL Configuration for MISRA"
2+
3+
queries:
4+
- uses: codeql/cpp-queries
5+
- uses: codeql/misra-cpp-coding-standards
6+
7+
paths-ignore:
8+
- "**/*test*"
9+
- "**/*mock*"
10+
- "**/test/**"
11+
- "**/mock/**"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
deviations: []
2+
guideline-recategorizations: []
3+
deviation-permits: []

.github/workflows/codeql-multiple-repo-scan.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,19 @@ jobs:
3636
- name: Checkout central repository
3737
uses: actions/checkout@v4
3838

39+
- name: Checkout CodeQL Coding Standards scripts
40+
uses: actions/checkout@v4
41+
with:
42+
repository: github/codeql-coding-standards
43+
path: codeql-coding-standards-repo # Klonen in diesen Ordner
44+
ref: main # Oder eine spezifische Release-Version, z.B. 'v2.53.0-dev'
45+
46+
# Add coding standard packages and dependencies
47+
- name: Install Python dependencies for Coding Standards scripts
48+
run: |
49+
python3 -m pip install --upgrade pip
50+
pip3 install pyyaml jsonpath-ng jsonschema jsonpatch jsonpointer pytest
51+
3952
- name: Parse known_good.json and create repos.json
4053
id: parse-repos
4154
run: |
@@ -141,6 +154,7 @@ jobs:
141154
languages: cpp
142155
build-mode: none
143156
packs: codeql/misra-cpp-coding-standards
157+
config-file: ./.github/codeql/codeql-config.yml
144158

145159
- name: Perform CodeQL Analysis
146160
uses: github/codeql-action/analyze@v4
@@ -149,6 +163,22 @@ jobs:
149163
output: sarif-results/
150164
category: "multi-repo-scan"
151165

166+
- name: Recategorize Guidelines
167+
if: always()
168+
run: |
169+
RECATEGORIZE_SCRIPT="codeql-coding-standards-repo/scripts/guideline_recategorization/recategorize.py"
170+
CODING_STANDARDS_CONFIG="./.github/codeql/coding-standards.yml"
171+
mkdir -p sarif-results-recategorized
172+
for sarif_file in sarif-results/*.sarif; do
173+
echo "Processing $sarif_file for recategorization..."
174+
python3.9 "$RECATEGORIZE_SCRIPT" \
175+
coding_standards_config_file "$CODING_STANDARDS_CONFIG" \
176+
sarif_in "$sarif_file" \
177+
sarif_out "sarif-results-recategorized/$(basename "$sarif_file")"
178+
done
179+
rm -rf sarif-results/*
180+
mv sarif-results-recategorized/* sarif-results/
181+
152182
- name: Upload SARIF results as artifact
153183
uses: actions/upload-artifact@v4
154184
with:

0 commit comments

Comments
 (0)