1515# $ ./ci/code_checks.sh code # checks on imported code
1616# $ ./ci/code_checks.sh doctests # run doctests
1717# $ ./ci/code_checks.sh docstrings # validate docstring errors
18- # $ ./ci/code_checks.sh dependencies # check that dependencies are consistent
1918# $ ./ci/code_checks.sh typing # run static type analysis
2019
21- [[ -z " $1 " || " $1 " == " lint" || " $1 " == " patterns" || " $1 " == " code" || " $1 " == " doctests" || " $1 " == " docstrings" || " $1 " == " dependencies " || " $1 " == " typing" ]] || \
22- { echo " Unknown command $1 . Usage: $0 [lint|patterns|code|doctests|docstrings|dependencies| typing]" ; exit 9999; }
20+ [[ -z " $1 " || " $1 " == " lint" || " $1 " == " patterns" || " $1 " == " code" || " $1 " == " doctests" || " $1 " == " docstrings" || " $1 " == " typing" ]] || \
21+ { echo " Unknown command $1 . Usage: $0 [lint|patterns|code|doctests|docstrings|typing]" ; exit 9999; }
2322
2423BASE_DIR=" $( dirname $0 ) /.."
2524RET=0
4847# ## LINTING ###
4948if [[ -z " $CHECK " || " $CHECK " == " lint" ]]; then
5049
51- echo " black --version"
52- black --version
53-
54- MSG=' Checking black formatting' ; echo $MSG
55- black . --check
56- RET=$(( $RET + $? )) ; echo $MSG " DONE"
57-
58- # `setup.cfg` contains the list of error codes that are being ignored in flake8
59-
60- echo " flake8 --version"
61- flake8 --version
62-
63- # pandas/_libs/src is C code, so no need to search there.
64- MSG=' Linting .py code' ; echo $MSG
65- flake8 --format=" $FLAKE8_FORMAT " .
66- RET=$(( $RET + $? )) ; echo $MSG " DONE"
67-
68- MSG=' Linting .pyx and .pxd code' ; echo $MSG
69- flake8 --format=" $FLAKE8_FORMAT " pandas --append-config=flake8/cython.cfg
70- RET=$(( $RET + $? )) ; echo $MSG " DONE"
71-
72- MSG=' Linting .pxi.in' ; echo $MSG
73- flake8 --format=" $FLAKE8_FORMAT " pandas/_libs --append-config=flake8/cython-template.cfg
74- RET=$(( $RET + $? )) ; echo $MSG " DONE"
75-
7650 # Check that cython casting is of the form `<type>obj` as opposed to `<type> obj`;
7751 # it doesn't make a difference, but we want to be internally consistent.
7852 # Note: this grep pattern is (intended to be) equivalent to the python
@@ -125,19 +99,6 @@ if [[ -z "$CHECK" || "$CHECK" == "lint" ]]; then
12599 fi
126100 RET=$(( $RET + $? )) ; echo $MSG " DONE"
127101
128- echo " isort --version-number"
129- isort --version-number
130-
131- # Imports - Check formatting using isort see setup.cfg for settings
132- MSG=' Check import format using isort' ; echo $MSG
133- ISORT_CMD=" isort --quiet --check-only pandas asv_bench scripts web"
134- if [[ " $GITHUB_ACTIONS " == " true" ]]; then
135- eval $ISORT_CMD | awk ' {print "##[error]" $0}' ; RET=$(( $RET + ${PIPESTATUS[0]} ))
136- else
137- eval $ISORT_CMD
138- fi
139- RET=$(( $RET + $? )) ; echo $MSG " DONE"
140-
141102fi
142103
143104# ## PATTERNS ###
@@ -354,15 +315,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
354315
355316fi
356317
357- # ## DEPENDENCIES ###
358- if [[ -z " $CHECK " || " $CHECK " == " dependencies" ]]; then
359-
360- MSG=' Check that requirements-dev.txt has been generated from environment.yml' ; echo $MSG
361- $BASE_DIR /scripts/generate_pip_deps_from_conda.py --compare --azure
362- RET=$(( $RET + $? )) ; echo $MSG " DONE"
363-
364- fi
365-
366318# ## TYPING ###
367319if [[ -z " $CHECK " || " $CHECK " == " typing" ]]; then
368320
@@ -374,5 +326,4 @@ if [[ -z "$CHECK" || "$CHECK" == "typing" ]]; then
374326 RET=$(( $RET + $? )) ; echo $MSG " DONE"
375327fi
376328
377-
378329exit $RET
0 commit comments