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 47D4E18C78 for ; Sun, 17 Apr 2016 17:14:50 +0000 (UTC) Received: (qmail 54636 invoked by uid 500); 17 Apr 2016 17:14:50 -0000 Delivered-To: apmail-yetus-commits-archive@yetus.apache.org Received: (qmail 54546 invoked by uid 500); 17 Apr 2016 17:14:50 -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 54332 invoked by uid 99); 17 Apr 2016 17:14:49 -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; Sun, 17 Apr 2016 17:14:49 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 8065EE78B5; Sun, 17 Apr 2016 17:14:49 +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: Sun, 17 Apr 2016 17:15:00 -0000 Message-Id: <6fc797c9f428409f80c702af95776f73@git.apache.org> In-Reply-To: <454431215a98480b8d4cb2bd8781f5e6@git.apache.org> References: <454431215a98480b8d4cb2bd8781f5e6@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [12/23] yetus git commit: YETUS-350. plug-in changes for build driver YETUS-350. plug-in changes for build driver 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/882b1b7c Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/882b1b7c Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/882b1b7c Branch: refs/heads/YETUS-156 Commit: 882b1b7c35d8940e6768b1ffc9ef7073ed1468fb Parents: 25b9f8c Author: Allen Wittenauer Authored: Tue Mar 29 16:57:57 2016 -0700 Committer: Allen Wittenauer Committed: Sun Apr 17 10:14:34 2016 -0700 ---------------------------------------------------------------------- precommit/test-patch.d/asflicense.sh | 8 ++-- precommit/test-patch.d/author.sh | 74 +++++++++++++++++++++++++------ precommit/test-patch.d/autoconf.sh | 14 +++--- precommit/test-patch.d/checkstyle.sh | 25 +++++------ precommit/test-patch.d/cmake.sh | 4 +- precommit/test-patch.d/findbugs.sh | 15 ++++--- precommit/test-patch.d/gradle.sh | 4 +- precommit/test-patch.d/maven.sh | 32 +++++++++---- precommit/test-patch.d/perlcritic.sh | 8 ++-- precommit/test-patch.d/pylint.sh | 12 ++--- precommit/test-patch.d/rubocop.sh | 8 ++-- precommit/test-patch.d/ruby-lint.sh | 8 ++-- precommit/test-patch.d/shellcheck.sh | 8 ++-- precommit/test-patch.d/shelldocs.sh | 8 ++-- precommit/test-patch.d/test4tests.sh | 4 ++ precommit/test-patch.d/whitespace.sh | 38 +++++++++++----- precommit/test-patch.d/xml.sh | 6 +-- 17 files changed, 177 insertions(+), 99 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/yetus/blob/882b1b7c/precommit/test-patch.d/asflicense.sh ---------------------------------------------------------------------- diff --git a/precommit/test-patch.d/asflicense.sh b/precommit/test-patch.d/asflicense.sh index edf7a7f..593e4af 100755 --- a/precommit/test-patch.d/asflicense.sh +++ b/precommit/test-patch.d/asflicense.sh @@ -61,7 +61,7 @@ function asflicense_tests local numpatch local btfails=true - big_console_header "Determining number of patched ASF License errors" + big_console_header "Determining number of ASF License errors" start_clock @@ -105,7 +105,7 @@ function asflicense_tests # RAT fails the build if there are license problems. # so let's take advantage of that a bit. if [[ $? == 0 && ${btfails} = true ]]; then - add_vote_table 1 asflicense "Patch does not generate ASF License warnings." + add_vote_table 1 asflicense "${BUILDMODEMSG} does not generate ASF License warnings." return 0 fi @@ -134,7 +134,7 @@ function asflicense_tests echo "There appear to be ${numpatch} ASF License warnings after applying the patch." if [[ -n ${numpatch} && ${numpatch} -gt 0 ]] ; then - add_vote_table -1 asflicense "Patch generated ${numpatch} ASF License warnings." + add_vote_table -1 asflicense "${BUILDMODEMSG} generated ${numpatch} ASF License warnings." echo "Lines that start with ????? in the ASF License "\ "report indicate files that do not have an Apache license header:" \ @@ -146,7 +146,7 @@ function asflicense_tests add_footer_table asflicense "@@BASE@@/patch-asflicense-problems.txt" return 1 fi - add_vote_table 1 asflicense "Patch does not generate ASF License warnings." + add_vote_table 1 asflicense "${BUILDMODEMSG} does not generate ASF License warnings." return 0 } http://git-wip-us.apache.org/repos/asf/yetus/blob/882b1b7c/precommit/test-patch.d/author.sh ---------------------------------------------------------------------- diff --git a/precommit/test-patch.d/author.sh b/precommit/test-patch.d/author.sh index 4497d03..2e148d8 100755 --- a/precommit/test-patch.d/author.sh +++ b/precommit/test-patch.d/author.sh @@ -16,21 +16,50 @@ add_test_type author -## @description Check the current directory for @author tags +## @description helper function for @author tags check ## @audience private ## @stability evolving ## @replaceable no ## @return 0 on success ## @return 1 on failure +function author_generic +{ + declare authortags + declare i + + # shellcheck disable=SC2016 + authortags=$(wc -l "${PATCH_DIR}/author-tags.txt" | "${AWK}" '{print $1}') + echo "There appear to be ${authortags} @author tags in the patch." + if [[ ${authortags} != 0 ]] ; then + add_vote_table -1 @author \ + "${BUILDMODEMSG} appears to contain ${authortags} @author tags which the" \ + " community has agreed to not allow in code contributions." + add_footer_table @author "@@BASE@@/author-tags.txt" + return 1 + fi + add_vote_table +1 @author "${BUILDMODEMSG} does not contain any @author tags." + return 0 +} + +## @description Check the current patchfile for @author tags +## @audience private +## @stability evolving +## @replaceable no +## @return 0 on success +## @return 1 on failure +## @param patchfile function author_patchfile { declare patchfile=$1 - declare authorTags # shellcheck disable=SC2155 declare -r appname=$(basename "${BASH_SOURCE-$0}") declare i - big_console_header "Checking there are no @author tags in the patch." + if [[ "${BUILDMODE}" != patch ]]; then + return + fi + + big_console_header "Checking for @author tags: ${BUILDMODE}" start_clock @@ -43,16 +72,33 @@ function author_patchfile done ${GREP} -i -n '^[^-].*@author' "${patchfile}" >> "${PATCH_DIR}/author-tags.txt" - # shellcheck disable=SC2016 - authorTags=$(wc -l "${PATCH_DIR}/author-tags.txt" | "${AWK}" '{print $1}') - echo "There appear to be ${authorTags} @author tags in the patch." - if [[ ${authorTags} != 0 ]] ; then - add_vote_table -1 @author \ - "The patch appears to contain ${authorTags} @author tags which the" \ - " community has agreed to not allow in code contributions." - add_footer_table @author "@@BASE@@/author-tags.txt" - return 1 + author_generic +} + + +## @description Check the current directory for @author tags +## @audience private +## @stability evolving +## @replaceable no +## @return 0 on success +## @return 1 on failure +function author_postcompile +{ + # shellcheck disable=SC2155 + declare -r appname=$(basename "${BASH_SOURCE-$0}") + declare i + + if [[ "${BUILDMODE}" != full ]]; then + return fi - add_vote_table +1 @author "The patch does not contain any @author tags." - return 0 + + big_console_header "Checking for @author tags: ${BUILDMODE}" + + start_clock + + "${GIT}" grep -n -I --extended-regexp -i '^[^-].*@author' \ + | ${GREP} -v "${appname}" \ + >> "${PATCH_DIR}/author-tags.txt" + + author_generic } http://git-wip-us.apache.org/repos/asf/yetus/blob/882b1b7c/precommit/test-patch.d/autoconf.sh ---------------------------------------------------------------------- diff --git a/precommit/test-patch.d/autoconf.sh b/precommit/test-patch.d/autoconf.sh index 2937e72..933a8c0 100755 --- a/precommit/test-patch.d/autoconf.sh +++ b/precommit/test-patch.d/autoconf.sh @@ -91,9 +91,9 @@ function autoconf_precompile fi if [[ "${repostatus}" = branch ]]; then - big_console_header "Pre-patch ${PATCH_BRANCH} autoconf verification" + big_console_header "autoconf verification: ${PATCH_BRANCH}" else - big_console_header "Patch autoconf verification" + big_console_header "autoconf verification: ${BUILDMODE}" fi personality_modules "${repostatus}" autoreconf @@ -108,7 +108,7 @@ function autoconf_precompile # shellcheck disable=SC2153 add_vote_table -1 autoreconf "${PATCH_BRANCH} unable to autoreconf" else - add_vote_table -1 autoreconf "${repostatus} unable to autoreconf" + add_vote_table -1 autoreconf "${BUILDMODEMSG} is unable to autoreconf" fi add_footer_table "autoreconf" "@@BASE@@/${repostatus}-autoconf-autoreconf" return 1 @@ -117,7 +117,7 @@ function autoconf_precompile # shellcheck disable=SC2153 add_vote_table +1 autoreconf "${PATCH_BRANCH} autoreconf successful" else - add_vote_table +1 autoreconf "${repostatus} autoreconf successful" + add_vote_table +1 autoreconf "${BUILDMODEMSG} can autoreconf" fi fi @@ -138,7 +138,7 @@ function autoconf_precompile # shellcheck disable=SC2153 add_vote_table -1 configure "${PATCH_BRANCH} unable to configure" else - add_vote_table -1 configure "${repostatus} unable to configure" + add_vote_table -1 configure "${BUILDMODEMSG} is unable to configure" fi add_footer_table "configure" "@@BASE@@/${repostatus}-autoconf-configure" return 1 @@ -147,7 +147,7 @@ function autoconf_precompile # shellcheck disable=SC2153 add_vote_table +1 configure "${PATCH_BRANCH} configure successful" else - add_vote_table +1 configure "${repostatus} configure successful" + add_vote_table +1 configure "${BUILDMODEMSG} can configure" fi fi return 0 @@ -201,4 +201,4 @@ function autoconf_builtin_personality_file_tests else make_builtin_personality_file_tests "${filename}" fi -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/yetus/blob/882b1b7c/precommit/test-patch.d/checkstyle.sh ---------------------------------------------------------------------- diff --git a/precommit/test-patch.d/checkstyle.sh b/precommit/test-patch.d/checkstyle.sh index 4363e4d..bba3369 100755 --- a/precommit/test-patch.d/checkstyle.sh +++ b/precommit/test-patch.d/checkstyle.sh @@ -140,7 +140,6 @@ function checkstyle_runner declare savestop declare output declare logfile - declare repo declare modulesuffix declare cmd declare logline @@ -151,12 +150,6 @@ function checkstyle_runner # first, let's clear out any previous run information modules_reset - if [[ ${repostatus} == branch ]]; then - repo=${PATCH_BRANCH} - else - repo="the patch" - fi - # loop through the modules we've been given #shellcheck disable=SC2153 until [[ $i -eq ${#MODULE[@]} ]]; do @@ -200,14 +193,14 @@ function checkstyle_runner > "${tmp}" if [[ $? == 0 ]] ; then - module_status ${i} +1 "${logfile}" "${modulesuffix} in ${repo} passed checkstyle" + module_status ${i} +1 "${logfile}" "${BUILDMODEMSG} ${modulesuffix} passed checkstyle" else - module_status ${i} -1 "${logfile}" "${modulesuffix} in ${repo} failed checkstyle" + module_status ${i} -1 "${logfile}" "${BUILDMODEMSG} ${modulesuffix} failed checkstyle" ((result = result + 1)) fi # if we have some output, we need to do more work: - if [[ -s ${tmp} ]]; then + if [[ -s ${tmp} && "${BUILDMODE}" = patch ]]; then # first, let's pull out all of the files that # we actually care about, esp since that run @@ -219,6 +212,7 @@ function checkstyle_runner ${GREP} "${j}" "${tmp}" >> "${tmp}.1" done + # now that we have just the files we care about, # let's unscrew it. You see... @@ -248,7 +242,8 @@ function checkstyle_runner popd >/dev/null # later on, calcdiff will turn this into code(:column):error # compare, and then put the file:line back onto it. - + else + cp -p "${tmp}" "${output}" fi rm "${tmp}" "${tmp}.1" 2>/dev/null @@ -288,7 +283,7 @@ function checkstyle_preapply return 0 fi - big_console_header "${PATCH_BRANCH} checkstyle" + big_console_header "checkstyle: ${PATCH_BRANCH}" start_clock @@ -321,7 +316,7 @@ function checkstyle_postapply return 0 fi - big_console_header "Patch checkstyle plugin" + big_console_header "checkstyle: ${BUILDMODE}" start_clock @@ -371,9 +366,9 @@ function checkstyle_postapply if [[ ${addpatch} -gt 0 ]] ; then ((result = result + 1)) - module_status ${i} -1 "diff-checkstyle-${fn}.txt" "${mod}: patch ${statstring}" + module_status ${i} -1 "diff-checkstyle-${fn}.txt" "${mod}: ${BUILDMODEMSG} ${statstring}" elif [[ ${fixedpatch} -gt 0 ]]; then - module_status ${i} +1 "diff-checkstyle-${fn}.txt" "${mod}: patch ${statstring}" + module_status ${i} +1 "diff-checkstyle-${fn}.txt" "${mod}: ${BUILDMODEMSG} ${statstring}" summarize=false fi ((i=i+1)) http://git-wip-us.apache.org/repos/asf/yetus/blob/882b1b7c/precommit/test-patch.d/cmake.sh ---------------------------------------------------------------------- diff --git a/precommit/test-patch.d/cmake.sh b/precommit/test-patch.d/cmake.sh index 9b5f265..7e68a4d 100755 --- a/precommit/test-patch.d/cmake.sh +++ b/precommit/test-patch.d/cmake.sh @@ -128,9 +128,9 @@ function cmake_precompile if [[ "${repostatus}" = branch ]]; then # shellcheck disable=SC2153 - big_console_header "${PATCH_BRANCH} cmake CMakeLists.txt" + big_console_header "cmake CMakeLists.txt: ${PATCH_BRANCH}" else - big_console_header "Patch cmake CMakeLists.txt" + big_console_header "cmake CMakeLists.txt: ${BUILDMODE}" fi personality_modules "${repostatus}" CMakeLists.txt http://git-wip-us.apache.org/repos/asf/yetus/blob/882b1b7c/precommit/test-patch.d/findbugs.sh ---------------------------------------------------------------------- diff --git a/precommit/test-patch.d/findbugs.sh b/precommit/test-patch.d/findbugs.sh index e4399fc..152d85f 100755 --- a/precommit/test-patch.d/findbugs.sh +++ b/precommit/test-patch.d/findbugs.sh @@ -95,10 +95,8 @@ function findbugs_precheck ## @audience private ## @stability evolving ## @replaceable no -## @param repostatus function findbugs_maven_skipper { - declare repostat=$1 declare -i i=0 declare skiplist=() declare modname @@ -122,7 +120,11 @@ function findbugs_maven_skipper done if [[ -n "${modname}" ]]; then - add_vote_table 0 findbugs "Skipped ${repostat} modules with no Java source: ${skiplist[*]}" + if [[ "${BUILDMODE}" = patch ]]; then + add_vote_table 0 findbugs "Skipped patched modules with no Java source: ${skiplist[*]}" + else + add_vote_table 0 findbugs "Skipped ${#skiplist[@]} modules in the source tree with no Java source." + fi fi } @@ -132,6 +134,7 @@ function findbugs_maven_skipper ## @replaceable no ## @return 0 on success ## @return 1 on failure +## @param repostatus function findbugs_runner { local name=$1 @@ -147,7 +150,7 @@ function findbugs_runner # strip out any modules that aren't actually java modules # this can save a lot of time during testing if [[ "${BUILDTOOL}" = maven ]]; then - findbugs_maven_skipper "${name}" + findbugs_maven_skipper fi "${BUILDTOOL}_modules_worker" "${name}" findbugs @@ -248,7 +251,7 @@ function findbugs_preapply return 0 fi - big_console_header "Pre-patch findbugs detection" + big_console_header "findbugs detection: ${PATCH_BRANCH}" findbugs_runner branch result=$? @@ -329,7 +332,7 @@ function findbugs_postinstall return 0 fi - big_console_header "Patch findbugs detection" + big_console_header "findbugs detection: ${BUILDMODE}" findbugs_runner patch http://git-wip-us.apache.org/repos/asf/yetus/blob/882b1b7c/precommit/test-patch.d/gradle.sh ---------------------------------------------------------------------- diff --git a/precommit/test-patch.d/gradle.sh b/precommit/test-patch.d/gradle.sh index 1f971fa..e809465 100755 --- a/precommit/test-patch.d/gradle.sh +++ b/precommit/test-patch.d/gradle.sh @@ -106,9 +106,9 @@ function gradle_precompile if [[ "${repostatus}" = branch ]]; then # shellcheck disable=SC2153 - big_console_header "${PATCH_BRANCH} gradle bootstrap" + big_console_header "gradle boostrap: ${PATCH_BRANCH}" else - big_console_header "Patch gradle bootstrap" + big_console_header "gradle bootstrap: ${BUILDMODE}" fi personality_modules "${repostatus}" gradleboot http://git-wip-us.apache.org/repos/asf/yetus/blob/882b1b7c/precommit/test-patch.d/maven.sh ---------------------------------------------------------------------- diff --git a/precommit/test-patch.d/maven.sh b/precommit/test-patch.d/maven.sh index 1a2a86b..32f4b37 100755 --- a/precommit/test-patch.d/maven.sh +++ b/precommit/test-patch.d/maven.sh @@ -95,6 +95,11 @@ function maven_parse_args function maven_initialize { + if ! verify_command "maven" "${MAVEN}"; then + return 1 + fi + + # we need to do this before docker does it as root maven_add_install mvneclipse maven_add_install mvnsite @@ -139,7 +144,7 @@ function maven_precheck fi if [[ ${MAVEN_CUSTOM_REPOS} = true ]]; then - MAVEN_LOCAL_REPO="${MAVEN_CUSTOM_REPOS_DIR}/${PROJECT_NAME}-${PATCH_BRANCH}-${INSTANCE}" + MAVEN_LOCAL_REPO="${MAVEN_CUSTOM_REPOS_DIR}/${PROJECT_NAME}-${PATCH_BRANCH}-${BUILDMODE}-${INSTANCE}" if [[ -e "${MAVEN_LOCAL_REPO}" && ! -d "${MAVEN_LOCAL_REPO}" ]]; then yetus_error "ERROR: ${MAVEN_LOCAL_REPO} is not a directory." @@ -369,7 +374,8 @@ function maven_builtin_personality_modules # this always makes sure the local repo has a fresh # copy of everything per pom rules. if [[ ${repostatus} == branch - && ${testtype} == mvninstall ]];then + && ${testtype} == mvninstall ]] || + [[ "${BUILDMODE}" = full ]];then personality_enqueue_module "${CHANGED_UNION_MODULES}" return fi @@ -450,9 +456,9 @@ function mvnsite_postcompile fi if [[ "${repostatus}" = branch ]]; then - big_console_header "Pre-patch ${PATCH_BRANCH} maven site verification" + big_console_header "maven site verification: ${PATCH_BRANCH}" else - big_console_header "Patch maven site verification" + big_console_header "maven site verification: ${BUILDMODE}" fi personality_modules "${repostatus}" mvnsite @@ -485,9 +491,9 @@ function mvneclipse_postcompile fi if [[ "${repostatus}" = branch ]]; then - big_console_header "Pre-patch ${PATCH_BRANCH} maven eclipse verification" + big_console_header "maven eclipse verification: ${PATCH_BRANCH}" else - big_console_header "Patch maven eclipse verification" + big_console_header "maven eclipse verification: ${BUILDMODE}" fi personality_modules "${repostatus}" mvneclipse @@ -536,10 +542,14 @@ function maven_precompile return 0 fi + if [[ "${BUILDMODE}" = Full ]]; then + return 0 + fi + if [[ "${repostatus}" = branch ]]; then - big_console_header "Pre-patch ${PATCH_BRANCH} maven install" + big_console_header "maven install: ${PATCH_BRANCH}" else - big_console_header "Patch maven install" + big_console_header "maven install: ${BUILDMODE}" fi personality_modules "${repostatus}" mvninstall @@ -675,5 +685,9 @@ function maven_reorder_modules yetus_debug "Maven: finish re-ordering modules" yetus_debug "Finished list: ${CHANGED_MODULES[*]}" - add_vote_table 0 mvndep "Maven dependency ordering for ${repostatus}" + if [[ "${BUILDMODE}" = patch ]]; then + add_vote_table 0 mvndep "Maven dependency ordering for ${repostatus}" + else + add_vote_table 0 mvndep "Maven dependency ordering" + fi } http://git-wip-us.apache.org/repos/asf/yetus/blob/882b1b7c/precommit/test-patch.d/perlcritic.sh ---------------------------------------------------------------------- diff --git a/precommit/test-patch.d/perlcritic.sh b/precommit/test-patch.d/perlcritic.sh index 8297f46..b376347 100755 --- a/precommit/test-patch.d/perlcritic.sh +++ b/precommit/test-patch.d/perlcritic.sh @@ -64,7 +64,7 @@ function perlcritic_preapply return 0 fi - big_console_header "Perl::Critic plugin: prepatch" + big_console_header "Perl::Critic plugin: ${PATCH_BRANCH}" start_clock @@ -106,7 +106,7 @@ function perlcritic_postapply return 0 fi - big_console_header "Perl::Critic plugin: postpatch" + big_console_header "Perl::Critic plugin: ${BUILDMODE}" start_clock @@ -147,11 +147,11 @@ function perlcritic_postapply statstring=$(generic_calcdiff_status "${numPrepatch}" "${numPostpatch}" "${diffPostpatch}" ) if [[ ${diffPostpatch} -gt 0 ]]; then - add_vote_table -1 perlcritic "The applied patch ${statstring}" + add_vote_table -1 perlcritic "${BUILDMODEMSG} ${statstring}" add_footer_table perlcritic "@@BASE@@/diff-patch-perlcritic.txt" return 1 elif [[ ${fixedpatch} -gt 0 ]]; then - add_vote_table +1 perlcritic "The applied patch ${statstring}" + add_vote_table +1 perlcritic "${BUILDMODEMSG} ${statstring}" return 0 fi http://git-wip-us.apache.org/repos/asf/yetus/blob/882b1b7c/precommit/test-patch.d/pylint.sh ---------------------------------------------------------------------- diff --git a/precommit/test-patch.d/pylint.sh b/precommit/test-patch.d/pylint.sh index 2a9e1f8..0f1790f 100755 --- a/precommit/test-patch.d/pylint.sh +++ b/precommit/test-patch.d/pylint.sh @@ -71,7 +71,7 @@ function pylint_preapply return 0 fi - big_console_header "pylint plugin: prepatch" + big_console_header "pylint plugin: ${PATCH_BRANCH}" start_clock @@ -87,7 +87,7 @@ function pylint_preapply if [[ -f ${PATCH_DIR}/${pylintStderr} ]]; then count=$(${GREP} -vc "^No config file found" "${PATCH_DIR}/${pylintStderr}") if [[ ${count} -gt 0 ]]; then - add_footer_table pylint "prepatch stderr: @@BASE@@/${pylintStderr}" + add_footer_table pylint "${PATCH_BRANCH} stderr: @@BASE@@/${pylintStderr}" return 1 fi fi @@ -113,7 +113,7 @@ function pylint_postapply return 0 fi - big_console_header "pylint plugin: postpatch" + big_console_header "pylint plugin: ${BUILDMODE}" start_clock @@ -135,7 +135,7 @@ function pylint_postapply count=$(${GREP} -vc "^No config file found" "${PATCH_DIR}/${pylintStderr}") if [[ ${count} -gt 0 ]]; then add_vote_table -1 pylint "Something bad seems to have happened in running pylint. Please check pylint stderr files." - add_footer_table pylint "postpatch stderr: @@BASE@@/${pylintStderr}" + add_footer_table pylint "${BUILDMODEMSG} stderr: @@BASE@@/${pylintStderr}" return 1 fi fi @@ -158,11 +158,11 @@ function pylint_postapply statstring=$(generic_calcdiff_status "${numPrepatch}" "${numPostpatch}" "${diffPostpatch}" ) if [[ ${diffPostpatch} -gt 0 ]] ; then - add_vote_table -1 pylint "The applied patch ${statstring}" + add_vote_table -1 pylint "${BUILDMODEMSG} ${statstring}" add_footer_table pylint "@@BASE@@/diff-patch-pylint.txt" return 1 elif [[ ${fixedpatch} -gt 0 ]]; then - add_vote_table +1 pylint "The applied patch ${statstring}" + add_vote_table +1 pylint "${BUILDMODEMSG} ${statstring}" return 0 fi http://git-wip-us.apache.org/repos/asf/yetus/blob/882b1b7c/precommit/test-patch.d/rubocop.sh ---------------------------------------------------------------------- diff --git a/precommit/test-patch.d/rubocop.sh b/precommit/test-patch.d/rubocop.sh index 8e1d5b8..f73c073 100755 --- a/precommit/test-patch.d/rubocop.sh +++ b/precommit/test-patch.d/rubocop.sh @@ -64,7 +64,7 @@ function rubocop_preapply return 0 fi - big_console_header "rubocop plugin: prepatch" + big_console_header "rubocop plugin: ${PATCH_BRANCH}" start_clock @@ -106,7 +106,7 @@ function rubocop_postapply return 0 fi - big_console_header "rubocop plugin: postpatch" + big_console_header "rubocop plugin: ${BUILDMODE}" start_clock @@ -146,11 +146,11 @@ function rubocop_postapply statstring=$(generic_calcdiff_status "${numPrepatch}" "${numPostpatch}" "${diffPostpatch}" ) if [[ ${diffPostpatch} -gt 0 ]] ; then - add_vote_table -1 rubocop "The applied patch ${statstring}" + add_vote_table -1 rubocop "${BUILDMODEMSG} ${statstring}" add_footer_table rubocop "@@BASE@@/diff-patch-rubocop.txt" return 1 elif [[ ${fixedpatch} -gt 0 ]]; then - add_vote_table +1 rubocop "The applied patch ${statstring}" + add_vote_table +1 rubocop "${BUILDMODEMSG} ${statstring}" return 0 fi http://git-wip-us.apache.org/repos/asf/yetus/blob/882b1b7c/precommit/test-patch.d/ruby-lint.sh ---------------------------------------------------------------------- diff --git a/precommit/test-patch.d/ruby-lint.sh b/precommit/test-patch.d/ruby-lint.sh index 94d4f53..c57887b 100755 --- a/precommit/test-patch.d/ruby-lint.sh +++ b/precommit/test-patch.d/ruby-lint.sh @@ -63,7 +63,7 @@ function ruby_lint_preapply return 0 fi - big_console_header "ruby-lint plugin: prepatch" + big_console_header "ruby-lint plugin: ${PATCH_BRANCH}" start_clock @@ -136,7 +136,7 @@ function ruby_lint_postapply return 0 fi - big_console_header "ruby-lint plugin: postpatch" + big_console_header "ruby-lint plugin: ${BUILDMODE}" start_clock @@ -176,11 +176,11 @@ function ruby_lint_postapply statstring=$(generic_calcdiff_status "${numPrepatch}" "${numPostpatch}" "${diffPostpatch}" ) if [[ ${diffPostpatch} -gt 0 ]] ; then - add_vote_table -1 ruby-lint "The applied patch ${statstring}" + add_vote_table -1 ruby-lint "${BUILDMODEMSG} ${statstring}" add_footer_table ruby-lint "@@BASE@@/diff-patch-ruby-lint.txt" return 1 elif [[ ${fixedpatch} -gt 0 ]]; then - add_vote_table +1 ruby-lint "The applied patch ${statstring}" + add_vote_table +1 ruby-lint "${BUILDMODEMSG} ${statstring}" return 0 fi http://git-wip-us.apache.org/repos/asf/yetus/blob/882b1b7c/precommit/test-patch.d/shellcheck.sh ---------------------------------------------------------------------- diff --git a/precommit/test-patch.d/shellcheck.sh b/precommit/test-patch.d/shellcheck.sh index e9a7e15..0e053e3 100755 --- a/precommit/test-patch.d/shellcheck.sh +++ b/precommit/test-patch.d/shellcheck.sh @@ -106,7 +106,7 @@ function shellcheck_preapply return 0 fi - big_console_header "shellcheck plugin: prepatch" + big_console_header "shellcheck plugin: ${PATCH_BRANCH}" start_clock @@ -157,7 +157,7 @@ function shellcheck_postapply return 0 fi - big_console_header "shellcheck plugin: postpatch" + big_console_header "shellcheck plugin: ${BUILDMODE}" start_clock @@ -194,12 +194,12 @@ function shellcheck_postapply statstring=$(generic_calcdiff_status "${numPrepatch}" "${numPostpatch}" "${diffPostpatch}" ) if [[ ${diffPostpatch} -gt 0 ]] ; then - add_vote_table -1 shellcheck "The applied patch ${statstring}" + add_vote_table -1 shellcheck "${BUILDMODEMSG} ${statstring}" add_footer_table shellcheck "@@BASE@@/diff-patch-shellcheck.txt" bugsystem_linecomments "shellcheck" "${PATCH_DIR}/diff-patch-shellcheck.txt" return 1 elif [[ ${fixedpatch} -gt 0 ]]; then - add_vote_table +1 shellcheck "The applied patch ${statstring}" + add_vote_table +1 shellcheck "${BUILDMODEMSG} ${statstring}" return 0 fi http://git-wip-us.apache.org/repos/asf/yetus/blob/882b1b7c/precommit/test-patch.d/shelldocs.sh ---------------------------------------------------------------------- diff --git a/precommit/test-patch.d/shelldocs.sh b/precommit/test-patch.d/shelldocs.sh index fea982a..d52fa6b 100755 --- a/precommit/test-patch.d/shelldocs.sh +++ b/precommit/test-patch.d/shelldocs.sh @@ -103,7 +103,7 @@ function shelldocs_preapply return 0 fi - big_console_header "shelldocs plugin: prepatch" + big_console_header "shelldocs plugin: ${PATCH_BRANCH}" start_clock @@ -134,7 +134,7 @@ function shelldocs_postapply return 0 fi - big_console_header "shelldocs plugin: postpatch" + big_console_header "shelldocs plugin: ${BUILDMODE}" start_clock @@ -170,12 +170,12 @@ function shelldocs_postapply statstring=$(generic_calcdiff_status "${numPrepatch}" "${numPostpatch}" "${diffPostpatch}" ) if [[ ${diffPostpatch} -gt 0 ]] ; then - add_vote_table -1 shelldocs "The applied patch ${statstring}" + add_vote_table -1 shelldocs "${BUILDMODEMSG} ${statstring}" add_footer_table shelldocs "@@BASE@@/diff-patch-shelldocs.txt" bugsystem_linecomments "shelldocs" "${PATCH_DIR}/diff-patch-shelldocs.txt" return 1 elif [[ ${fixedpatch} -gt 0 ]]; then - add_vote_table +1 shelldocs "The applied patch ${statstring}" + add_vote_table +1 shelldocs "${BUILDMODEMSG} ${statstring}" return 0 fi http://git-wip-us.apache.org/repos/asf/yetus/blob/882b1b7c/precommit/test-patch.d/test4tests.sh ---------------------------------------------------------------------- diff --git a/precommit/test-patch.d/test4tests.sh b/precommit/test-patch.d/test4tests.sh index 644fbf9..6c3230c 100755 --- a/precommit/test-patch.d/test4tests.sh +++ b/precommit/test-patch.d/test4tests.sh @@ -27,6 +27,10 @@ function test4tests_patchfile declare testReferences=0 declare i + if [[ "${BUILDMODE}" = full ]]; then + return + fi + big_console_header "Checking there are new or changed tests in the patch." if ! verify_needed_test unit; then http://git-wip-us.apache.org/repos/asf/yetus/blob/882b1b7c/precommit/test-patch.d/whitespace.sh ---------------------------------------------------------------------- diff --git a/precommit/test-patch.d/whitespace.sh b/precommit/test-patch.d/whitespace.sh index a613d81..da0789b 100755 --- a/precommit/test-patch.d/whitespace.sh +++ b/precommit/test-patch.d/whitespace.sh @@ -49,21 +49,37 @@ function whitespace_postcompile start_clock pushd "${BASEDIR}" >/dev/null - # shellcheck disable=SC2016 - ${AWK} '/\t/ {print $0}' \ - "${GITDIFFCONTENT}" \ - | ${GREP} -v Makefile: >> "${PATCH_DIR}/whitespace-tabs.txt" - ${GREP} -E '[[:blank:]]$' \ - "${GITDIFFCONTENT}" \ - >> "${PATCH_DIR}/whitespace-eol.txt" + case "${BUILDMODE}" in + patch) + # shellcheck disable=SC2016 + ${AWK} '/\t/ {print $0}' \ + "${GITDIFFCONTENT}" \ + | ${GREP} -v Makefile: >> "${PATCH_DIR}/whitespace-tabs.txt" + + ${GREP} -E '[[:blank:]]$' \ + "${GITDIFFCONTENT}" \ + >> "${PATCH_DIR}/whitespace-eol.txt" + ;; + full) + ${GIT} grep -n -I --extended-regexp '[[:blank:]]$' \ + >> "${PATCH_DIR}/whitespace-eol.txt" + ${GIT} grep -n -I $'\t' \ + | "${GREP}" -v Makefile \ + >> "${PATCH_DIR}/whitespace-tabs.txt" + ;; + esac # shellcheck disable=SC2016 count=$(wc -l "${PATCH_DIR}/whitespace-eol.txt" | ${AWK} '{print $1}') if [[ ${count} -gt 0 ]]; then - add_vote_table -1 whitespace "The patch has ${count}"\ - " line(s) that end in whitespace. Use git apply --whitespace=fix." + if [[ "${BUILDMODE}" = full ]]; then + add_vote_table -1 whitespace "${BUILDMODEMSG} has ${count} line(s) that end in whitespace." + else + add_vote_table -1 whitespace \ + "${BUILDMODEMSG} has ${count} line(s) that end in whitespace. Use git apply --whitespace=fix." + fi whitespace_linecomment_reporter "${PATCH_DIR}/whitespace-eol.txt" "end of line" add_footer_table whitespace "@@BASE@@/whitespace-eol.txt" @@ -74,7 +90,7 @@ function whitespace_postcompile count=$(wc -l "${PATCH_DIR}/whitespace-tabs.txt" | ${AWK} '{print $1}') if [[ ${count} -gt 0 ]]; then - add_vote_table -1 whitespace "The patch has ${count}"\ + add_vote_table -1 whitespace "${BUILDMODEMSG} ${count}"\ " line(s) with tabs." add_footer_table whitespace "@@BASE@@/whitespace-tabs.txt" whitespace_linecomment_reporter "${PATCH_DIR}/whitespace-tabs.txt" "tabs in line" @@ -87,6 +103,6 @@ function whitespace_postcompile fi popd >/dev/null - add_vote_table +1 whitespace "Patch has no whitespace issues." + add_vote_table +1 whitespace "${BUILDMODEMSG} has no whitespace issues." return 0 } http://git-wip-us.apache.org/repos/asf/yetus/blob/882b1b7c/precommit/test-patch.d/xml.sh ---------------------------------------------------------------------- diff --git a/precommit/test-patch.d/xml.sh b/precommit/test-patch.d/xml.sh index 08e0a61..6460522 100755 --- a/precommit/test-patch.d/xml.sh +++ b/precommit/test-patch.d/xml.sh @@ -48,7 +48,7 @@ function xml_postcompile return 0 fi - big_console_header "Checking if XML files are well-formed" + big_console_header "XML verification: ${BUILDMODE}" js="${JAVA_HOME}/bin/jrunscript" @@ -65,13 +65,13 @@ function xml_postcompile done if [[ ${count} -gt 0 ]]; then - add_vote_table -1 xml "The patch has ${count} ill-formed XML file(s)." + add_vote_table -1 xml "${BUILDMODEMSG} has ${count} ill-formed XML file(s)." add_footer_table xml "@@BASE@@/xml.txt" popd >/dev/null return 1 fi popd >/dev/null - add_vote_table +1 xml "The patch has no ill-formed XML file." + add_vote_table +1 xml "${BUILDMODEMSG} has no ill-formed XML file." return 0 }