From 6b2efdfae5302427543ef42686c35db737da6261 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Cami?= Date: Sat, 29 Jun 2019 00:38:04 +0200 Subject: [PATCH] Makefile.am: add .in files to fastlint target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously fastlint would only process .py files. Detect which .in files are in fact Python files and add them to the list of files to process during the fastlint Makefile target. Original change suggested by Alexander Bokovoy. Fixes: https://pagure.io/freeipa/issue/7984 Signed-off-by: François Cami Reviewed-By: Rob Crittenden Reviewed-By: Alexander Bokovoy --- Makefile.am | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 4c5a0e16d..7d84aa532 100644 --- a/Makefile.am +++ b/Makefile.am @@ -219,8 +219,19 @@ endif @echo "Fast linting with $(PYTHON) from branch '$(GIT_BRANCH)'" @MERGEBASE=$$(git merge-base --fork-point $(GIT_BRANCH)); \ - FILES=$$(git diff --name-only --diff-filter=d $${MERGEBASE} \ - | grep -E '\.py$$'); \ + PYFILES=$$(git diff --name-only --diff-filter=d $${MERGEBASE} \ + | grep -E '\.py$$' ); \ + INFILES=$$(git diff --name-only --diff-filter=d $${MERGEBASE} \ + | grep -E '\.in$$' \ + | xargs -n1 file 2>/dev/null | grep Python \ + | cut -d':' -f1; ); \ + if [ -n "$${PYFILES}" ] && [ -n "$${INFILES}" ]; then \ + FILES="$$( printf $${PYFILES}\\n$${INFILES} )" ; \ + elif [ -n "$${PYFILES}" ]; then \ + FILES="$${PYFILES}" ; \ + else \ + FILES="$${INFILES}" ; \ + fi ; \ if [ -n "$${FILES}" ]; then \ echo -e "Fast linting files:\n$${FILES}\n"; \ echo "pycodestyle"; \