Skip to content

Commit 64b1168

Browse files
jrebackjorisvandenbossche
authored andcommitted
BLD: fix linting check for .pyx
closes pandas-dev#14659 (cherry picked from commit 52241a7)
1 parent 826b076 commit 64b1168

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

ci/lint.sh

+12-12
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,27 @@ source activate pandas
77
RET=0
88

99
if [ "$LINT" ]; then
10-
echo "Linting"
11-
for path in 'api' 'core' 'indexes' 'types' 'formats' 'io' 'stats' 'compat' 'sparse' 'tools' 'tseries' 'tests' 'computation' 'util'
12-
do
13-
echo "linting -> pandas/$path"
14-
flake8 pandas/$path --filename '*.py'
15-
if [ $? -ne "0" ]; then
16-
RET=1
17-
fi
18-
19-
done
10+
# pandas/rpy is deprecated and will be removed.
11+
# pandas/src is C code, so no need to search there.
12+
echo "Linting *.py"
13+
flake8 pandas --filename=*.py --exclude pandas/rpy,pandas/src
14+
if [ $? -ne "0" ]; then
15+
RET=1
16+
fi
2017
echo "Linting *.py DONE"
2118

2219
echo "Linting *.pyx"
23-
flake8 pandas --filename '*.pyx' --select=E501,E302,E203,E111,E114,E221,E303,E128,E231,E126
20+
flake8 pandas --filename=*.pyx --select=E501,E302,E203,E111,E114,E221,E303,E128,E231,E126
21+
if [ $? -ne "0" ]; then
22+
RET=1
23+
fi
2424
echo "Linting *.pyx DONE"
2525

2626
echo "Linting *.pxi.in"
2727
for path in 'src'
2828
do
2929
echo "linting -> pandas/$path"
30-
flake8 pandas/$path --filename '*.pxi.in' --select=E501,E302,E203,E111,E114,E221,E303,E231,E126
30+
flake8 pandas/$path --filename=*.pxi.in --select=E501,E302,E203,E111,E114,E221,E303,E231,E126
3131
if [ $? -ne "0" ]; then
3232
RET=1
3333
fi

pandas/tslib.pyx

+4-2
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,8 @@ class Timestamp(_Timestamp):
688688
def validate(k, v):
689689
""" validate integers """
690690
if not isinstance(v, int):
691-
raise ValueError("value must be an integer, received {v} for {k}".format(v=type(v), k=k))
691+
raise ValueError("value must be an integer, received "
692+
"{v} for {k}".format(v=type(v), k=k))
692693
return v
693694

694695
for k, v in kwds.items():
@@ -5105,7 +5106,8 @@ cpdef normalize_date(object dt):
51055106
normalized : datetime.datetime or Timestamp
51065107
"""
51075108
if is_timestamp(dt):
5108-
return dt.replace(hour=0, minute=0, second=0, microsecond=0, nanosecond=0)
5109+
return dt.replace(hour=0, minute=0, second=0, microsecond=0,
5110+
nanosecond=0)
51095111
elif PyDateTime_Check(dt):
51105112
return dt.replace(hour=0, minute=0, second=0, microsecond=0)
51115113
elif PyDate_Check(dt):

0 commit comments

Comments
 (0)