From 4488b3a0e4b10b37a891da9ecd979eade149cb48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= Date: Tue, 14 Feb 2017 16:49:27 +0100 Subject: [PATCH 1/2] Add 'lint' target to Makefile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The target executes pylint on all *.py files, except for those in the ./tests and ./experiments subdirectories. Signed-off-by: Ondřej Lysoněk --- Makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6200cae..99ba88b 100644 --- a/Makefile +++ b/Makefile @@ -182,4 +182,12 @@ clean: test: python -m unittest discover tests -.PHONY: clean archive srpm tag test +lint: + $(eval tmpfile := $(shell mktemp)) + find . \( -path ./experiments -o -path ./tests \) -prune \ + -or -name '*.py' \ + \( -exec bash -c "pylint -E {} > $(tmpfile) 2> /dev/null" \; \ + -or \( -print -exec cat $(tmpfile) \; \) \) + rm -f $(tmpfile) + +.PHONY: clean archive srpm tag test lint From 0f22a5e12c24abd6b68bb91c67ac326513033b9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= Date: Thu, 16 Feb 2017 09:17:19 +0100 Subject: [PATCH 2/2] Simplify the 'lint' target in Makefile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ondřej Lysoněk --- Makefile | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 99ba88b..16e3621 100644 --- a/Makefile +++ b/Makefile @@ -183,11 +183,6 @@ test: python -m unittest discover tests lint: - $(eval tmpfile := $(shell mktemp)) - find . \( -path ./experiments -o -path ./tests \) -prune \ - -or -name '*.py' \ - \( -exec bash -c "pylint -E {} > $(tmpfile) 2> /dev/null" \; \ - -or \( -print -exec cat $(tmpfile) \; \) \) - rm -f $(tmpfile) + pylint -E tuned *.py .PHONY: clean archive srpm tag test lint