File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,11 @@ set -euo pipefail
33
44ROOT_DIR=$( pwd)
55
6+ is_third_party_file () {
7+ local source_file=" $1 "
8+ [[ " $source_file " == ThirdParty/* ]]
9+ }
10+
611append_include_args () {
712 local raw_paths=" $1 "
813 local split_paths
@@ -24,7 +29,13 @@ FILES_URL="$(jq -r '.pull_request._links.self.href' "$GITHUB_EVENT_PATH")/files"
2429FILES=$( curl -s -X GET -G " $FILES_URL " | jq -r ' .[] | .filename' )
2530echo " ====Files Changed in PR===="
2631echo " $FILES "
27- filecount=$( echo " $FILES " | grep -c -E ' \.(cpp|cc|cxx|c)$' || true)
32+ filecount=$(
33+ while read -r line; do
34+ if [[ " $line " =~ \. (cpp| cc| cxx| c)$ ]] && ! is_third_party_file " $line " ; then
35+ echo " $line "
36+ fi
37+ done <<< " $FILES" | grep -c .
38+ )
2839echo " Total changed: $filecount "
2940tidyerr=0
3041if (( filecount > 0 && filecount <= 25 )) ; then
@@ -57,6 +68,10 @@ if ((filecount > 0 && filecount <= 25)); then
5768 fi
5869 while read -r line; do
5970 if echo " $line " | grep -E ' \.(cpp|cc|cxx|c)$' ; then
71+ if is_third_party_file " $line " ; then
72+ echo " skipping ${line} : third-party source"
73+ continue
74+ fi
6075 source_file=" ${ROOT_DIR} /${line} "
6176 if ! file_in_compile_db " $source_file " ; then
6277 echo " skipping ${line} : not present in compilation database"
You can’t perform that action at this time.
0 commit comments