a0baed4280
Reviewers: buda, mislav.bradac Reviewed By: mislav.bradac Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D597
17 lines
444 B
Bash
Executable File
17 lines
444 B
Bash
Executable File
#!/bin/bash
|
|
|
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
cd "$DIR/../../"
|
|
|
|
errfile="$DIR/.cppcheck_errors"
|
|
|
|
files=$( git diff --name-only HEAD~1 HEAD | egrep '^(src|tests|poc)' | egrep '.(hpp|h|cpp)$' )
|
|
cppcheck --enable=all --force --suppress=missingInclude -Isrc $files 2>"$errfile"
|
|
|
|
cat "$errfile" >&2
|
|
|
|
len="$( cat "$errfile" | wc -l )"
|
|
if [ $len -gt 0 ]; then
|
|
echo -e "Cppcheck errors:\n$( cat "$errfile" )" > "$errfile"
|
|
fi
|