Skip to content

Commit

Permalink
CI: Allow no argument in code_checks (pandas-dev#56751)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhshadrach authored and pmhatre1 committed May 7, 2024
1 parent d49adf3 commit c9f2b3e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,18 @@

set -uo pipefail

[[ -z "$1" || "$1" == "code" || "$1" == "doctests" || "$1" == "docstrings" || "$1" == "single-docs" || "$1" == "notebooks" ]] || \
if [[ -v 1 ]]; then
CHECK=$1
else
# script will fail if it uses an unset variable (i.e. $1 is not provided)
CHECK=""
fi

[[ -z "$CHECK" || "$CHECK" == "code" || "$CHECK" == "doctests" || "$CHECK" == "docstrings" || "$CHECK" == "single-docs" || "$CHECK" == "notebooks" ]] || \
{ echo "Unknown command $1. Usage: $0 [code|doctests|docstrings|single-docs|notebooks]"; exit 9999; }

BASE_DIR="$(dirname $0)/.."
RET=0
CHECK=$1

### CODE ###
if [[ -z "$CHECK" || "$CHECK" == "code" ]]; then
Expand Down

0 comments on commit c9f2b3e

Please sign in to comment.