From 0a3754d534ecb980c5f2a0b48d7948eb891a1bbd Mon Sep 17 00:00:00 2001 From: Deda Date: Sun, 25 Feb 2024 21:34:18 +0100 Subject: [PATCH] Fix code analysis --- tests/code_analysis/python_code_analysis.sh | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/tests/code_analysis/python_code_analysis.sh b/tests/code_analysis/python_code_analysis.sh index 7352c2454..500a873d1 100755 --- a/tests/code_analysis/python_code_analysis.sh +++ b/tests/code_analysis/python_code_analysis.sh @@ -3,29 +3,20 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" PROJECT_ROOT="$SCRIPT_DIR/../.." BASE_BRANCH="origin/master" -if [[ "$#" -ne 2 ]]; then - echo "Error: This script requires exactly 1 argument '--base-branch string', not $#" - exit 1 -fi - -while [[ "$#" -gt 0 ]]; do +if [[ "$#" -gt 0 ]]; then case "$1" in --base-branch) BASE_BRANCH=$2 - shift 2 ;; *) echo "Error: Unknown flag '$1'" exit 1 ;; esac -done - -echo $SCRIPT_DIR -echo $PROJECT_ROOT +fi cd $PROJECT_ROOT -CHANGED_FILES=$(git diff -U0 $BASE_BRANCH ... --name-only --diff-filter=d) +CHANGED_FILES=$(git diff -U0 $BASE_BRANCH... --name-only --diff-filter=d) for file in ${CHANGED_FILES}; do echo ${file} if [[ ${file} == *.py ]]; then