summaryrefslogtreecommitdiffstats
path: root/Makefile.am
diff options
context:
space:
mode:
authorPetr Spacek <pspacek@redhat.com>2016-11-08 09:55:13 +0100
committerMartin Babinsky <mbabinsk@redhat.com>2016-11-09 13:08:32 +0100
commit14c1c8dfd0aa894af2d60dfa4f2ce2510d791328 (patch)
treecb428d66f1fa7d155fc9566d7643a0dc2392617b /Makefile.am
parent2df98772556de0d964028bbb78a9efbdd13ecd40 (diff)
downloadfreeipa-14c1c8dfd0aa894af2d60dfa4f2ce2510d791328.tar.gz
freeipa-14c1c8dfd0aa894af2d60dfa4f2ce2510d791328.tar.xz
freeipa-14c1c8dfd0aa894af2d60dfa4f2ce2510d791328.zip
Build: add Python lint target
https://fedorahosted.org/freeipa/ticket/6418 Reviewed-By: Martin Basti <mbasti@redhat.com> Reviewed-By: Christian Heimes <cheimes@redhat.com>
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am22
1 files changed, 22 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index eed7d9ffd..90b1c1ee9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -44,3 +44,25 @@ rpms: dist-gzip rpmroot rpmdistdir
rpmbuild --define "_topdir $(RPMBUILD)" -ba $(top_builddir)/$(PACKAGE).spec
cp $(RPMBUILD)/RPMS/*/*.rpm $(top_builddir)/dist/rpms/
cp $(RPMBUILD)/SRPMS/*.src.rpm $(top_builddir)/dist/srpms/
+
+.PHONY: lint
+if WITH_PYLINT
+PYLINT_TARGET = pylint
+endif WITH_PYLINT
+lint: $(PYLINT_TARGET)
+
+.PHONY: pylint
+pylint:
+ FILES=`find $(top_srcdir) \
+ -type d -exec test -e '{}/__init__.py' \; -print -prune -o \
+ -path '*/.*' -o \
+ -path '*.in' -o \
+ -path './dist/*' -o \
+ -path './lextab.py' -o \
+ -path './yacctab.py' -o \
+ -name '*~' -o \
+ -name \*.py -print -o \
+ -type f -exec grep -qsm1 '^#!.*\bpython' '{}' \; -print`; \
+ echo "Pylint is running, please wait ..."; \
+ PYTHONPATH=$(top_srcdir) $(PYLINT) \
+ --rcfile=$(top_srcdir)/pylintrc $${FILES}