From 2038ce3e3ecb3a098a5a18a9069c6d1ee94d21d5 Mon Sep 17 00:00:00 2001 From: Jenny Shu <28537278+jenshu@users.noreply.github.com> Date: Tue, 14 Jan 2025 12:20:18 -0500 Subject: [PATCH] remove DO_NOT_SUBMIT check (#10450) --- .github/workflows/static-analysis.yaml | 7 ----- ci/do-not-submit.sh | 43 -------------------------- 2 files changed, 50 deletions(-) delete mode 100755 ci/do-not-submit.sh diff --git a/.github/workflows/static-analysis.yaml b/.github/workflows/static-analysis.yaml index c0149cd796c..5a7088b2ca3 100644 --- a/.github/workflows/static-analysis.yaml +++ b/.github/workflows/static-analysis.yaml @@ -22,13 +22,6 @@ jobs: - name: Generate Code run: | ./ci/check-generated-code.sh - - name: Get changed files - id: changed-files - uses: tj-actions/changed-files@v45 - - name: Check for DO_NOT_SUBMIT - # documentation for where we get the list of files to pass into the script: - # https://github.com/marketplace/actions/changed-files?version=v37#outputs - run: ./ci/do-not-submit.sh ${{ steps.changed-files.outputs.all_changed_files }} static-analysis: name: Lint Checks diff --git a/ci/do-not-submit.sh b/ci/do-not-submit.sh deleted file mode 100755 index c3730975875..00000000000 --- a/ci/do-not-submit.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -# do-not-submit.sh takes one or more file paths as arguments, then checks each -# of those files for comments including the DO_NOT_SUBMIT keyword. If the -# keyword is present, the script exits with -1. -# -# This implementation checks go.mod, *.go, and *.proto files for single-line comments -# (i.e. starting with // rather than /* ... */). -# -# This script is invoked by .github/workflows/do-not-submit.yaml - -if [[ "$#" -lt 1 ]]; then - echo "Usage: $0 filename [filenames ...]" - exit -1 -fi - -NEWLINE=$'\n' -OUTPUT="" -DO_NOT_SUBMIT_REGEX="[[:space:]]*//[[:space:]]*DO_NOT_SUBMIT" - -# Keeps track of number of go.mod, *.go, and *.proto files (as opposed to all files provided) -file_count=0 -for filename in "$@"; do - # Only check *.go files for now - if [[ "$filename" == *".go" || "$filename" == *"go.mod" || "$filename" == *".proto" ]]; then - ((file_count++)) - line_number=1 - while IFS= read -r line; do - if [[ "$line" =~ $DO_NOT_SUBMIT_REGEX ]]; then - OUTPUT="${OUTPUT}$filename:$line_number contains DO_NOT_SUBMIT${NEWLINE}" - fi - ((line_number++)) - done <"$filename" - fi -done - -if [[ "$OUTPUT" == "" ]]; then - echo "$file_count go files checked, none contain DO_NOT_SUBMIT" - exit 0 -else - echo "$OUTPUT" - exit -1 -fi