From 28c5e128c823f32787a4bde87e6b248928a2cd0a Mon Sep 17 00:00:00 2001 From: Tomas Krizek Date: Nov 16 2016 15:58:52 +0000 Subject: Build: ignore rpmbuild for lint target Exclude rpmbuild from pylint checks when make lint is executed. Clean up the current find expression. https://fedorahosted.org/freeipa/ticket/6418 Reviewed-By: Petr Spacek --- diff --git a/Makefile.am b/Makefile.am index 159d396..0ef5433 100644 --- a/Makefile.am +++ b/Makefile.am @@ -126,17 +126,21 @@ apilint: polint: $(MAKE) -C $(srcdir)/po validate-src-strings +# Run pylint for all python files. Finds all python files/packages, skips +# folders rpmbuild, freeipa-* and dist. Skip (match, but don't print) .*, +# *.in, *~. Finally print all python files, including scripts that do not +# have python extension. .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 \ + -path './rpmbuild' -prune -o \ + -path './freeipa-*' -prune -o \ + -path './dist' -prune -o \ + -name '.*' -o \ + -name '*.in' -o \ -name '*~' -o \ - -name \*.py -print -o \ + -name '*.py' -print -o \ -type f -exec grep -qsm1 '^#!.*\bpython' '{}' \; -print`; \ echo "Pylint is running, please wait ..."; \ PYTHONPATH=$(top_srcdir) $(PYLINT) \