aboutsummaryrefslogtreecommitdiff
path: root/scripts/pvscheck.sh
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-04-19 18:55:32 +0300
committerZyX <kp-pav@yandex.ru>2017-04-19 18:55:32 +0300
commit38b2bc9a883d88b5257673048f687c5ac1fe7446 (patch)
tree67f3727bb4fad2540484ded187e62fbcbc455755 /scripts/pvscheck.sh
parentf0c12012d99b33474bd6bb5dcb0ee3a6c6808789 (diff)
downloadrneovim-38b2bc9a883d88b5257673048f687c5ac1fe7446.tar.gz
rneovim-38b2bc9a883d88b5257673048f687c5ac1fe7446.tar.bz2
rneovim-38b2bc9a883d88b5257673048f687c5ac1fe7446.zip
scripts: Make pvs do not patch separate directory, add patch mode
Diffstat (limited to 'scripts/pvscheck.sh')
-rwxr-xr-xscripts/pvscheck.sh25
1 files changed, 17 insertions, 8 deletions
diff --git a/scripts/pvscheck.sh b/scripts/pvscheck.sh
index 2e4f990693..faa6f92c9a 100755
--- a/scripts/pvscheck.sh
+++ b/scripts/pvscheck.sh
@@ -12,20 +12,24 @@ help() {
echo 'Usage:'
echo ' pvscheck.sh [target-directory [branch]]'
echo ' pvscheck.sh [--recheck] [target-directory]'
+ echo ' pvscheck.sh --patch'
echo
- echo ' --recheck: run analysis on a prepared target directory'
+ echo ' --patch: patch sources in the current directory.'
+ echo ' Does not run analysis.'
echo
- echo ' target-directory: Directory where build should occur'
+ echo ' --recheck: run analysis on a prepared target directory.'
+ echo
+ echo ' target-directory: Directory where build should occur.'
echo ' Default: ../neovim-pvs'
echo
- echo ' branch: Branch to check'
- echo ' Default: master'
+ echo ' branch: Branch to check.'
+ echo ' Default: master.'
}
get_pvs_comment() {
cat > pvs-comment << EOF
-// This is an open source non-commercial project. Dear PVS-Studio, please check it.
-// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
+// This is an open source non-commercial project. Dear PVS-Studio, please check
+// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
EOF
}
@@ -75,6 +79,8 @@ patch_sources() {
build/src/nvim/auto build/config \
-name '*.[ch]' -not -name '*.test-include.c' \
-exec /bin/sh -c "$sh_script" - '{}' \;
+
+ rm pvs-comment
}
run_analysis() {
@@ -103,8 +109,6 @@ do_check() {
create_compile_commands
- patch_sources
-
run_analysis
}
@@ -128,6 +132,11 @@ main() {
set -x
+ if test "x$1" = "x--patch" ; then
+ patch_sources
+ exit $?
+ fi
+
local recheck=
if test "x$1" = "x--recheck" ; then
recheck=1