This is an automated email from the ASF dual-hosted git repository. aw pushed a commit to branch YETUS-1034-release in repository https://gitbox.apache.org/repos/asf/yetus.git
commit 7977c8f11705c0e3adf8b5e6b5a7c3f2535e9774 Author: Allen Wittenauer <[email protected]> AuthorDate: Mon Nov 2 06:17:33 2020 -0800 YETUS-1064. buf does not generate annotations (#185) --- precommit/src/main/shell/test-patch.d/buf.sh | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/precommit/src/main/shell/test-patch.d/buf.sh b/precommit/src/main/shell/test-patch.d/buf.sh index b3b2aa9..23682fb 100755 --- a/precommit/src/main/shell/test-patch.d/buf.sh +++ b/precommit/src/main/shell/test-patch.d/buf.sh @@ -52,6 +52,12 @@ function buf_parse_args ;; esac done + + if [[ -n "${BUF_BASEDIR}" ]]; then + # make sure this is relative and strip any ending / + BUF_BASEDIR=$(yetus_abs "${BUF_BASEDIR}") + BUF_BASEDIR=$(yetus_relative_dir "${BASEDIR}" "${BUF_BASEDIR}") + fi } function buf_filefilter @@ -131,19 +137,17 @@ function bufcompat_executor bufargs+=(--timeout "${BUF_TIMEOUT}") fi - if [[ -n "${BUF_BASEDIR}" ]]; then - pushd "${BASEDIR}/${BUF_BASEDIR}" >/dev/null || return 1 - else - pushd "${BASEDIR}" >/dev/null || return 1 - fi + pushd "${BASEDIR}/${BUF_BASEDIR}" >/dev/null || return 1 if [[ "${repostatus}" == "branch" ]]; then "${BUF}" image build "${bufargs[@]}" -o "${PATCH_DIR}/buf-image.bin" 2>> "${PATCH_DIR}/${bufStderr}" elif [[ -f "${PATCH_DIR}/buf-image.bin" ]]; then "${BUF}" check breaking "${bufargs[@]}" \ --against-input "${PATCH_DIR}/buf-image.bin" \ + 2>> "${PATCH_DIR}/${bufStderr}" \ + | "${AWK}" "{print \"${BUF_BASEDIR}/\"\$0}" \ > "${PATCH_DIR}/${repostatus}-bufcompat-result.txt" \ - 2>> "${PATCH_DIR}/${bufStderr}" + fi popd >/dev/null || return 1 @@ -259,14 +263,11 @@ function buflint_executor bufargs+=(--timeout "${BUF_TIMEOUT}") fi - if [[ -n "${BUF_BASEDIR}" ]]; then - pushd "${BASEDIR}/${BUF_BASEDIR}" >/dev/null || return 1 - else - pushd "${BASEDIR}" >/dev/null || return 1 - fi + pushd "${BASEDIR}/${BUF_BASEDIR}" >/dev/null || return 1 - "${BUF}" check lint "${bufargs[@]}" 2>> "${PATCH_DIR}/${bufStderr}" | \ - "${args[@]}" > "${PATCH_DIR}/${repostatus}-buflint-result.txt" + "${BUF}" check lint "${bufargs[@]}" 2>> "${PATCH_DIR}/${bufStderr}" \ + | "${AWK}" "{print \"${BUF_BASEDIR}/\"\$0}" \ + | "${args[@]}" > "${PATCH_DIR}/${repostatus}-buflint-result.txt" popd >/dev/null || return 1
