Skip to content

Commit 830f5e1

Browse files
committed
Stricter flake8 rules for pxd
1 parent f9a7bf1 commit 830f5e1

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ repos:
1313
- id: flake8
1414
name: flake8-pyx
1515
language: python_venv
16-
files: \.pyx$
16+
files: \.(pyx|pxd)$
1717
types:
1818
- file
1919
args: [--append-config=flake8/cython.cfg]
2020
- id: flake8
2121
name: flake8-pxd
2222
language: python_venv
23-
files: \.(pxd|pxi\.in)$
23+
files: \.pxi\.in$
2424
types:
2525
- file
26-
args: [--append-config=flake8/cython-header.cfg]
26+
args: [--append-config=flake8/cython-template.cfg]
2727
- repo: https://github.com/pre-commit/mirrors-isort
2828
rev: v4.3.21
2929
hooks:

ci/code_checks.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ if [[ -z "$CHECK" || "$CHECK" == "lint" ]]; then
6565
flake8 --format="$FLAKE8_FORMAT" .
6666
RET=$(($RET + $?)) ; echo $MSG "DONE"
6767

68-
MSG='Linting .pyx code' ; echo $MSG
68+
MSG='Linting .pyx and .pxd code' ; echo $MSG
6969
flake8 --format="$FLAKE8_FORMAT" pandas --append-config=flake8/cython.cfg
7070
RET=$(($RET + $?)) ; echo $MSG "DONE"
7171

72-
MSG='Linting .pxd and .pxi.in' ; echo $MSG
73-
flake8 --format="$FLAKE8_FORMAT" pandas/_libs --append-config=flake8/cython-header.cfg
72+
MSG='Linting .pxi.in' ; echo $MSG
73+
flake8 --format="$FLAKE8_FORMAT" pandas/_libs --append-config=flake8/cython-template.cfg
7474
RET=$(($RET + $?)) ; echo $MSG "DONE"
7575

7676
echo "flake8-rst --version"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[flake8]
2-
filename = *.pxd,*.pxi.in
2+
filename = *.pxi.in
33
select = E501,E302,E203,E111,E114,E221,E303,E231,E126,F403
44

flake8/cython.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[flake8]
2-
filename = *.pyx
2+
filename = *.pyx,*.pxd
33
select=E501,E302,E203,E111,E114,E221,E303,E128,E231,E126,E265,E305,E301,E127,E261,E271,E129,W291,E222,E241,E123,F403,C400,C401,C402,C403,C404,C405,C406,C407,C408,C409,C410,C411

pandas/_libs/sparse_op_helper.pxi.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ cdef inline tuple int_op_{{opname}}_{{dtype}}({{dtype}}_t[:] x_,
235235
{{dtype}}_t yfill):
236236
cdef:
237237
IntIndex out_index
238-
Py_ssize_t xi = 0, yi = 0, out_i = 0 # fp buf indices
238+
Py_ssize_t xi = 0, yi = 0, out_i = 0 # fp buf indices
239239
int32_t xloc, yloc
240240
int32_t[:] xindices, yindices, out_indices
241241
{{dtype}}_t[:] x, y

pandas/_libs/tslibs/util.pxd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ cdef extern from "numpy/ndarrayobject.h":
4242
bint PyArray_IsIntegerScalar(obj) nogil
4343
bint PyArray_Check(obj) nogil
4444

45-
cdef extern from "numpy/npy_common.h":
45+
cdef extern from "numpy/npy_common.h":
4646
int64_t NPY_MIN_INT64
4747

4848

0 commit comments

Comments
 (0)