From f2be33a67f833a2125e04bfb9baff8fd346b84e7 Mon Sep 17 00:00:00 2001 From: Brandon Stoll Date: Wed, 12 Jun 2024 16:40:23 +0000 Subject: [PATCH] Fix linter warnings --- .github/workflows/proto_breaking.yml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/proto_breaking.yml b/.github/workflows/proto_breaking.yml index 8f9b3be..af03f99 100644 --- a/.github/workflows/proto_breaking.yml +++ b/.github/workflows/proto_breaking.yml @@ -46,15 +46,21 @@ jobs: TMPDIRHEAD="${TMPDIR}/head" extract_protodesc() { - local TMPTARGETDIR="${1}" - local TARGETS="$(bazel query 'attr("generator_function", "^proto_library$", "//...")' 2>/dev/null)" - local GENF="$(bazel info bazel-genfiles)" + local TMPTARGETDIR + local TARGETS + local GENF + local TARGETDIR + local PROTONAME + TMPTARGETDIR="${1}" + TARGETS="$(bazel query 'attr("generator_function", "^proto_library$", "//...")' 2>/dev/null)" + GENF="$(bazel info bazel-genfiles)" for TARGET in ${TARGETS}; do - local TARGETDIR="$(echo "${TARGET}" | cut -d ":" -f1 | sed 's#^//##')" - local PROTONAME="$(echo "${TARGET}" | cut -d ":" -f2-)" + TARGETDIR="$(echo "${TARGET}" | cut -d ":" -f1 | sed 's#^//##')" + PROTONAME="$(echo "${TARGET}" | cut -d ":" -f2-)" mkdir -p "${TMPTARGETDIR}/${TARGETDIR}" bazel build "${TARGET}" - cp "${GENF}/${TARGETDIR}/${PROTONAME}-descriptor-set.proto.bin" "${TMPTARGETDIR}/${TARGETDIR}/${PROTONAME}-descriptor-set.proto.bin" + cp "${GENF}/${TARGETDIR}/${PROTONAME}-descriptor-set.proto.bin" \ + "${TMPTARGETDIR}/${TARGETDIR}/${PROTONAME}-descriptor-set.proto.bin" done } @@ -71,9 +77,10 @@ jobs: PROTONAME="$(echo "${TARGET}" | cut -d ":" -f2-)" BASEPROTODESC="${TMPDIRBASE}/${TARGETDIR}/${PROTONAME}-descriptor-set.proto.bin" HEADPROTODESC="${TMPDIRHEAD}/${TARGETDIR}/${PROTONAME}-descriptor-set.proto.bin" - if [ -f ${BASEPROTODESC} ] && [ -f ${HEADPROTODESC} ]; then + if [ -f "${BASEPROTODESC}" ] && [ -f "${HEADPROTODESC}" ]; then echo "Comparing build target ${TARGET} at HEAD and BASE..." - OUTPUT=$(proto-breaking-change-detector --original_descriptor_set_file_path="${BASEPROTODESC}" --update_descriptor_set_file_path="${HEADPROTODESC}" --human_readable_message 2>&1) + OUTPUT=$(proto-breaking-change-detector --original_descriptor_set_file_path="${BASEPROTODESC}" \ + --update_descriptor_set_file_path="${HEADPROTODESC}" --human_readable_message 2>&1) if [ "${OUTPUT}" == "" ]; then echo "No breaking changes." else