Hello,

please review attached patches which Split make lint to more targets and add jslint


--
Pavel^3 Vomacka

From f32919a910dc98301b373a47cc72f68b1310c0ee Mon Sep 17 00:00:00 2001
From: Pavel Vomacka <pvoma...@redhat.com>
Date: Tue, 2 Aug 2016 16:44:10 +0200
Subject: [PATCH 1/2] Split targets in Makefile

Separate aci and api check to new targets. Also separate lint check to pylint
and po-validation target. Prepares for easier adding of new lints.
---
 Makefile | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index d84927838cec9b8cf56cf2404c59f68808bce65f..16d7491cc939d53176893a05b268ea661c32e375 100644
--- a/Makefile
+++ b/Makefile
@@ -133,7 +133,17 @@ client-dirs:
 		echo "Without those directories ipa-client-install will fail" ; \
 	fi
 
-lint: bootstrap-autogen
+aci-check:
+	if [ "$(SKIP_API_VERSION_CHECK)" != "yes" ]; then \
+		./makeaci --validate; \
+	fi
+
+api-check:
+	if [ "$(SKIP_API_VERSION_CHECK)" != "yes" ]; then \
+		./makeapi --validate; \
+	fi
+
+pylint: bootstrap-autogen
 	# find all python modules and executable python files outside modules for pylint check
 	FILES=`find . \
 		-type d -exec test -e '{}/__init__.py' \; -print -prune -o \
@@ -146,8 +156,11 @@ lint: bootstrap-autogen
 		-type f -exec grep -qsm1 '^#!.*\bpython' '{}' \; -print`; \
 	echo "Pylint is running, please wait ..."; \
 	PYTHONPATH=. pylint --rcfile=pylintrc $(PYLINTFLAGS) $$FILES || $(LINT_IGNORE_FAIL)
+
+po-validate:
 	$(MAKE) -C install/po validate-src-strings || $(LINT_IGNORE_FAIL)
 
+lint: aci-check api-check pylint po-validate 
 
 test:
 	./make-test
@@ -198,11 +211,6 @@ version-update: release-update
 		ln -s $(SUPPORTED_PLATFORM)/constants.py ipaplatform/constants.py; \
 	fi
 
-	if [ "$(SKIP_API_VERSION_CHECK)" != "yes" ]; then \
-		./makeapi --validate && \
-		./makeaci --validate; \
-	fi
-
 server: version-update
 	$(PYTHON) setup.py build
 	cd ipaplatform && $(PYTHON) setup.py build
-- 
2.5.5

From 911c4f5c59b3e381aeff97a08bcba2b3a85e60d8 Mon Sep 17 00:00:00 2001
From: Pavel Vomacka <pvoma...@redhat.com>
Date: Tue, 2 Aug 2016 16:46:24 +0200
Subject: [PATCH 2/2] Add jslint to make lint target

Checks all JavaScript files
---
 Makefile        | 5 ++++-
 freeipa.spec.in | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 16d7491cc939d53176893a05b268ea661c32e375..71f693b60c1f59f47cddc0d356de95491dbffb10 100644
--- a/Makefile
+++ b/Makefile
@@ -160,7 +160,10 @@ pylint: bootstrap-autogen
 po-validate:
 	$(MAKE) -C install/po validate-src-strings || $(LINT_IGNORE_FAIL)
 
-lint: aci-check api-check pylint po-validate 
+jslint:
+	cd install/ui; jsl -nologo -nosummary -nofilelisting -conf jsl.conf || $(LINT_IGNORE_FAIL)
+
+lint: aci-check api-check pylint po-validate jslint
 
 test:
 	./make-test
diff --git a/freeipa.spec.in b/freeipa.spec.in
index 135e9c980011c6c2730c6c29a3c22098e48270d5..7fdea0d3133e99d581b05b6692637b3ec8ad1caf 100644
--- a/freeipa.spec.in
+++ b/freeipa.spec.in
@@ -87,6 +87,7 @@ BuildRequires:  python-dns >= 1.11.1
 BuildRequires:  libsss_idmap-devel
 BuildRequires:  libsss_nss_idmap-devel >= 1.14.0
 BuildRequires:  java-headless
+BuildRequires:  jsl
 BuildRequires:  rhino
 BuildRequires:  libverto-devel
 BuildRequires:  systemd
-- 
2.5.5

-- 
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