Skip to content

Commit dd25e37

Browse files
author
shenxianpeng
committed
#2 remove cppcheck
1 parent d089d34 commit dd25e37

File tree

5 files changed

+5
-19
lines changed

5 files changed

+5
-19
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
cppcheck-report.txt
21
clang-format-report.txt
32
clang-tidy-report.txt

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LABEL maintainer="shenxianpeng <[email protected]>"
1010

1111
WORKDIR /build
1212
RUN apt-get update
13-
RUN apt-get -qq -y install curl clang-tidy cmake jq clang cppcheck clang-format
13+
RUN apt-get -qq -y install curl clang-tidy cmake jq clang clang-format
1414

1515
ADD runchecks.sh /entrypoint.sh
1616
COPY . .

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# C/C++ Lint Action
22

3-
Github Actions for linting the C/C++ code. Integrated clang-tidy, clang-format, and Cppcheck checks.
3+
Github Actions for linting the C/C++ code. Integrated clang-tidy, clang-format checks.
44

55
## Integration with GitHub Actions
66

@@ -15,7 +15,7 @@ jobs:
1515
name: cpp-linter
1616
runs-on: ubuntu-latest
1717
steps:
18-
- name: cpp-linter
18+
- name: C/C++ Lint Action
1919
uses: shenxianpeng/cpp-linter-action@master
2020
with:
2121
fetch-depth: 0

action.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name: C/C++ code linter (clang-tidy, clang-format, and Cppcheck)
2-
description: Automatically checks pull requests changes with clang-tidy, clang-format, and Cppcheck and posts the comment with result.
1+
name: C/C++ code linter (clang-tidy and clang-format)
2+
description: Automatically checks pull requests changes with clang-tidy, clang-format and posts the comment with result.
33
author: shenxianpeng
44
branding:
55
icon: 'check-circle'

runchecks.sh

-13
Original file line numberDiff line numberDiff line change
@@ -27,28 +27,22 @@ echo "Files downloaded!"
2727
echo "Performing checkup:"
2828
clang-tidy --version
2929

30-
# clang-format --style=llvm -i *.c *.h *.cpp *.hpp *.C *.cc *.CPP *.c++ *.cp *.cxx > clang-format-report.txt
3130
for i in "${URLS[@]}"
3231
do
3332
filename=`basename $i`
3433
clang-tidy $filename -checks=boost-*,bugprone-*,performance-*,readability-*,portability-*,modernize-*,clang-analyzer-cplusplus-*,clang-analyzer-*,cppcoreguidelines-* >> clang-tidy-report.txt
3534
clang-format --dry-run -Werror $filename || echo "File: $filename not formatted!" >> clang-format-report.txt
3635
done
3736

38-
cppcheck --enable=all --std=c++11 --language=c++ --output-file=cppcheck-report.txt *.c *.h *.cpp *.hpp *.C *.cc *.CPP *.c++ *.cp *.cxx
39-
4037
PAYLOAD_TIDY=`cat clang-tidy-report.txt`
4138
PAYLOAD_FORMAT=`cat clang-format-report.txt`
42-
PAYLOAD_CPPCHECK=`cat cppcheck-report.txt`
4339
COMMENTS_URL=$(cat $GITHUB_EVENT_PATH | jq -r .pull_request.comments_url)
4440

4541
echo $COMMENTS_URL
4642
echo "Clang-tidy errors:"
4743
echo $PAYLOAD_TIDY
4844
echo "Clang-format errors:"
4945
echo $PAYLOAD_FORMAT
50-
echo "Cppcheck errors:"
51-
echo $PAYLOAD_CPPCHECK
5246

5347
if [ "$PAYLOAD_TIDY" != "" ]; then
5448
OUTPUT=$'**CLANG-TIDY WARNINGS**:\n'
@@ -64,13 +58,6 @@ if [ "$PAYLOAD_FORMAT" != "" ]; then
6458
OUTPUT+=$'\n```\n'
6559
fi
6660

67-
if [ "$PAYLOAD_CPPCHECK" != "" ]; then
68-
OUTPUT+=$'\n**CPPCHECK WARNINGS**:\n'
69-
OUTPUT+=$'\n```\n'
70-
OUTPUT+="$PAYLOAD_CPPCHECK"
71-
OUTPUT+=$'\n```\n'
72-
fi
73-
7461
echo "OUTPUT is: \n $OUTPUT"
7562

7663
PAYLOAD=$(echo '{}' | jq --arg body "$OUTPUT" '.body = $body')

0 commit comments

Comments
 (0)