3
3
# Run checks related to code quality.
4
4
#
5
5
# This script is intended for both the CI and to check locally that code standards are
6
- # respected. We are currently linting (PEP-8 and similar), looking for patterns of
7
- # common mistakes (sphinx directives with missing blank lines, old style classes,
8
- # unwanted imports...), we run doctests here (currently some files only), and we
6
+ # respected. We run doctests here (currently some files only), and we
9
7
# validate formatting error in docstrings.
10
8
#
11
9
# Usage:
12
10
# $ ./ci/code_checks.sh # run all checks
13
- # $ ./ci/code_checks.sh lint # run linting only
14
11
# $ ./ci/code_checks.sh code # checks on imported code
15
12
# $ ./ci/code_checks.sh doctests # run doctests
16
13
# $ ./ci/code_checks.sh docstrings # validate docstring errors
17
14
# $ ./ci/code_checks.sh typing # run static type analysis
18
15
19
- [[ -z " $1 " || " $1 " == " lint " || " $1 " == " code" || " $1 " == " doctests" || " $1 " == " docstrings" || " $1 " == " typing" ]] || \
20
- { echo " Unknown command $1 . Usage: $0 [lint| code|doctests|docstrings|typing]" ; exit 9999; }
16
+ [[ -z " $1 " || " $1 " == " code" || " $1 " == " doctests" || " $1 " == " docstrings" || " $1 " == " typing" ]] || \
17
+ { echo " Unknown command $1 . Usage: $0 [code|doctests|docstrings|typing]" ; exit 9999; }
21
18
22
19
BASE_DIR=" $( dirname $0 ) /.."
23
20
RET=0
@@ -40,23 +37,6 @@ if [[ "$GITHUB_ACTIONS" == "true" ]]; then
40
37
INVGREP_PREPEND=" ##[error]"
41
38
fi
42
39
43
- # ## LINTING ###
44
- if [[ -z " $CHECK " || " $CHECK " == " lint" ]]; then
45
-
46
- # Check that cython casting is of the form `<type>obj` as opposed to `<type> obj`;
47
- # it doesn't make a difference, but we want to be internally consistent.
48
- # Note: this grep pattern is (intended to be) equivalent to the python
49
- # regex r'(?<![ ->])> '
50
- MSG=' Linting .pyx code for spacing conventions in casting' ; echo $MSG
51
- invgrep -r -E --include ' *.pyx' --include ' *.pxi.in' ' [a-zA-Z0-9*]> ' pandas/_libs
52
- RET=$(( $RET + $? )) ; echo $MSG " DONE"
53
-
54
- # readability/casting: Warnings about C casting instead of C++ casting
55
- # runtime/int: Warnings about using C number types instead of C++ ones
56
- # build/include_subdir: Warnings about prefacing included header files with directory
57
-
58
- fi
59
-
60
40
# ## CODE ###
61
41
if [[ -z " $CHECK " || " $CHECK " == " code" ]]; then
62
42
0 commit comments