Skip to content

Commit 04b45b1

Browse files
authored
CI: Allow no argument in code_checks (#56751)
1 parent 99db9af commit 04b45b1

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ci/code_checks.sh

+8-2
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,18 @@
1616

1717
set -uo pipefail
1818

19-
[[ -z "$1" || "$1" == "code" || "$1" == "doctests" || "$1" == "docstrings" || "$1" == "single-docs" || "$1" == "notebooks" ]] || \
19+
if [[ -v 1 ]]; then
20+
CHECK=$1
21+
else
22+
# script will fail if it uses an unset variable (i.e. $1 is not provided)
23+
CHECK=""
24+
fi
25+
26+
[[ -z "$CHECK" || "$CHECK" == "code" || "$CHECK" == "doctests" || "$CHECK" == "docstrings" || "$CHECK" == "single-docs" || "$CHECK" == "notebooks" ]] || \
2027
{ echo "Unknown command $1. Usage: $0 [code|doctests|docstrings|single-docs|notebooks]"; exit 9999; }
2128

2229
BASE_DIR="$(dirname $0)/.."
2330
RET=0
24-
CHECK=$1
2531

2632
### CODE ###
2733
if [[ -z "$CHECK" || "$CHECK" == "code" ]]; then

0 commit comments

Comments
 (0)