Skip to content

Commit 84e0d79

Browse files
committed
CI: Reduce cpplint output to only changed lines
1 parent 7c11756 commit 84e0d79

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

.github/workflows/sub_lint.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,11 @@ jobs:
586586
if [ ${{ env.logdir }}cpplint.log ]
587587
then
588588
echo "::add-matcher::${{ runner.workspace }}/FreeCAD/.github/problemMatcher/cpplint.json"
589-
cat ${{ env.logdir }}cpplint.log
589+
590+
# Only show lint on changed lines:
591+
git diff -U0 origin/${{ github.event.pull_request.base.ref }} | grep -E '^\+\s' | sed 's/^+//' > changed_lines.txt
592+
grep -Ff changed_lines.txt ${{ env.logdir }}cpplint.log || true
593+
590594
echo "::remove-matcher owner=cpplint::"
591595
cpplintErrors=$(grep -nIHE "\[[0-9]\]$" ${{ env.logdir }}cpplint.log | wc -l ) || true
592596
fi

0 commit comments

Comments
 (0)