summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.travis.yml2
-rw-r--r--Makefile.am22
-rw-r--r--configure.ac16
3 files changed, 39 insertions, 1 deletions
diff --git a/.travis.yml b/.travis.yml
index 54b9ce6de..44a2ee684 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -13,4 +13,4 @@ script:
- >
docker run -v $PWD:/freeipa -w /freeipa
martbab/freeipa-fedora-builder:${TRAVIS_BRANCH}-latest
- /bin/bash -c 'dnf builddep -y -D "with_lint 1" --spec freeipa.spec.in && ./makerpms.sh'
+ /bin/bash -c 'dnf builddep -y -D "with_lint 1" --spec freeipa.spec.in && autoreconf -i && ./configure && make lint && make rpms'
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}
diff --git a/configure.ac b/configure.ac
index d6322b794..7c7c31ed1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -411,6 +411,22 @@ else
AC_MSG_RESULT(no)
fi
+dnl ---------------------------------------------------------------------------
+dnl Linters
+dnl ---------------------------------------------------------------------------
+AC_ARG_WITH([pylint],
+ AS_HELP_STRING([--with-pylint=path],
+ [path to Pylint]),
+dnl --without-pylint will set PYLINT=no
+ [PYLINT=$with_pylint],
+ [AC_PATH_PROG([PYLINT], [pylint])]
+)
+if test "x${PYLINT}" == "x"; then
+ AC_MSG_ERROR([cannot find Pylint])
+fi
+AC_SUBST([PYLINT])
+AM_CONDITIONAL([WITH_PYLINT], [test "x${PYLINT}" != "xno"])
+
# Flags
AC_SUBST(CFLAGS)