URL: https://github.com/freeipa/freeipa/pull/246
Author: tomaskrizek
 Title: #246: Build: ignore rpmbuild for lint target
Action: opened

PR body:
"""
Exclude rpmbuild from pylint checks when make lint is executed.
Clean up the current find expression.

https://fedorahosted.org/freeipa/ticket/6418
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/246/head:pr246
git checkout pr246
From ef8080f4527f3c837271529bf14c26371b46ded1 Mon Sep 17 00:00:00 2001
From: Tomas Krizek <tkri...@redhat.com>
Date: Wed, 16 Nov 2016 12:51:58 +0100
Subject: [PATCH] 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
---
 Makefile.am | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

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) \
-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to