[PATCH 2/3] Skip running pylint on files containing "skip-file".
Chris Lumens
clumens at redhat.com
Tue Apr 8 19:17:46 UTC 2014
pylint appears to check the syntax of an input file before checking whether
it should skip the file or not. Add a check in pylint-one.sh for this and
skip if requested. Doing this check here means the git hook understands
it too.
---
tests/pylint/pylint-one.sh | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tests/pylint/pylint-one.sh b/tests/pylint/pylint-one.sh
index abb3824..2a71545 100755
--- a/tests/pylint/pylint-one.sh
+++ b/tests/pylint/pylint-one.sh
@@ -8,6 +8,10 @@ if [ $# -lt 1 ]; then
exit 1
fi
+if [ ! -z "$(grep '# pylint: skip-file' $1)" ]; then
+ exit 0
+fi
+
file_suffix="$(eval echo \$$#|sed s?/?_?g)"
pylint_output="$(pylint \
--
1.8.3.1
More information about the anaconda-patches
mailing list