Return-Path: X-Original-To: apmail-yetus-commits-archive@minotaur.apache.org Delivered-To: apmail-yetus-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 80765198FA for ; Tue, 19 Apr 2016 23:10:46 +0000 (UTC) Received: (qmail 52821 invoked by uid 500); 19 Apr 2016 23:10:46 -0000 Delivered-To: apmail-yetus-commits-archive@yetus.apache.org Received: (qmail 52780 invoked by uid 500); 19 Apr 2016 23:10:46 -0000 Mailing-List: contact commits-help@yetus.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@yetus.apache.org Delivered-To: mailing list commits@yetus.apache.org Received: (qmail 52761 invoked by uid 99); 19 Apr 2016 23:10:46 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Apr 2016 23:10:46 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 134D0DFE5F; Tue, 19 Apr 2016 23:10:46 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aw@apache.org To: commits@yetus.apache.org Date: Tue, 19 Apr 2016 23:10:47 -0000 Message-Id: In-Reply-To: <4d328666eac44f13befd36e1ed03c7a6@git.apache.org> References: <4d328666eac44f13befd36e1ed03c7a6@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/2] yetus git commit: YETUS-385. test plugin for author tag detection should have a way to opt-out of specific instances YETUS-385. test plugin for author tag detection should have a way to opt-out of specific instances Signed-off-by: Allen Wittenauer Project: http://git-wip-us.apache.org/repos/asf/yetus/repo Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/3f782d34 Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/3f782d34 Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/3f782d34 Branch: refs/heads/YETUS-156 Commit: 3f782d3460fbfa9f01de96b22e1e843b8851d240 Parents: 088070a Author: Allen Wittenauer Authored: Mon Apr 18 13:40:37 2016 -0700 Committer: Allen Wittenauer Committed: Tue Apr 19 16:10:00 2016 -0700 ---------------------------------------------------------------------- precommit/test-patch.d/author.sh | 43 ++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/yetus/blob/3f782d34/precommit/test-patch.d/author.sh ---------------------------------------------------------------------- diff --git a/precommit/test-patch.d/author.sh b/precommit/test-patch.d/author.sh index 0e00c80..dccd504 100755 --- a/precommit/test-patch.d/author.sh +++ b/precommit/test-patch.d/author.sh @@ -16,6 +16,32 @@ add_test_type author +## @description author usage hook +## @audience private +## @stability evolving +## @replaceable no +function author_usage +{ + yetus_add_option "--author-ignore-list=" "list of filenames to ignore (full build mode only)" +} + +## @description author parse args hook +## @audience private +## @stability evolving +## @replaceable no +function author_parse_args +{ + declare i + + for i in "$@"; do + case ${i} in + --author-ignore-list=*) + yetus_comma_to_array AUTHOR_IGNORE_LIST "${i#*=}" + ;; + esac + done +} + ## @description helper function for @author tags check ## @audience private ## @stability evolving @@ -93,7 +119,7 @@ function author_postcompile { # shellcheck disable=SC2155 declare -r appname=$(basename "${BASH_SOURCE-$0}") - declare i + declare fn if [[ "${BUILDMODE}" != full ]]; then return @@ -103,9 +129,20 @@ function author_postcompile start_clock - "${GIT}" grep -n -I --extended-regexp -i '^[^-].*@author' \ + "${GIT}" grep -n -I --extended-regexp -i -e '^[^-].*@author' \ | ${GREP} -v "${appname}" \ - >> "${PATCH_DIR}/author-tags.txt" + >> "${PATCH_DIR}/author-tags-git.txt" + + if [[ -z "${AUTHOR_IGNORE_LIST[0]}" ]]; then + cp -p "${PATCH_DIR}/author-tags-git.txt" "${PATCH_DIR}/author-tags.txt" + else + cp -p "${PATCH_DIR}/author-tags-git.txt" "${PATCH_DIR}/author-tags.1" + for fn in "${AUTHOR_IGNORE_LIST[@]}"; do + ${GREP} -v -E "^${fn}" "${PATCH_DIR}/author-tags.1" >> "${PATCH_DIR}/author-tags.2" + mv "${PATCH_DIR}/author-tags.2" "${PATCH_DIR}/author-tags.1" + done + mv "${PATCH_DIR}/author-tags.1" "${PATCH_DIR}/author-tags.txt" + fi author_generic }