15
15
# $ ./ci/code_checks.sh code # checks on imported code
16
16
# $ ./ci/code_checks.sh doctests # run doctests
17
17
# $ ./ci/code_checks.sh docstrings # validate docstring errors
18
- # $ ./ci/code_checks.sh dependencies # check that dependencies are consistent
19
18
# $ ./ci/code_checks.sh typing # run static type analysis
20
19
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; }
23
22
24
23
BASE_DIR=" $( dirname $0 ) /.."
25
24
RET=0
48
47
# ## LINTING ###
49
48
if [[ -z " $CHECK " || " $CHECK " == " lint" ]]; then
50
49
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
-
76
50
# Check that cython casting is of the form `<type>obj` as opposed to `<type> obj`;
77
51
# it doesn't make a difference, but we want to be internally consistent.
78
52
# Note: this grep pattern is (intended to be) equivalent to the python
@@ -125,19 +99,6 @@ if [[ -z "$CHECK" || "$CHECK" == "lint" ]]; then
125
99
fi
126
100
RET=$(( $RET + $? )) ; echo $MSG " DONE"
127
101
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
-
141
102
fi
142
103
143
104
# ## PATTERNS ###
@@ -354,15 +315,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
354
315
355
316
fi
356
317
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
-
366
318
# ## TYPING ###
367
319
if [[ -z " $CHECK " || " $CHECK " == " typing" ]]; then
368
320
@@ -374,5 +326,4 @@ if [[ -z "$CHECK" || "$CHECK" == "typing" ]]; then
374
326
RET=$(( $RET + $? )) ; echo $MSG " DONE"
375
327
fi
376
328
377
-
378
329
exit $RET
0 commit comments