Skip to content

Commit 27d4d46

Browse files
committed
MAINT: Style check *.c and *.h files
"cpplint" was introduced gh-14740, and this commit extends to check other *.c and *.h files in the pandas repo. Currently, they all reside in pandas/src, and this commit expands the lint to check all of the following: 1) datetime (dir) 2) ujson (dir) 3) period_helper.c 4) All header files The parser directory was handled in gh-14740, and the others have been deliberately omitted.
1 parent 2466ecb commit 27d4d46

20 files changed

+5948
-6032
lines changed

ci/lint.sh

+13-4
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,22 @@ if [ "$LINT" ]; then
3838
# readability/casting: Warnings about C casting instead of C++ casting
3939
# runtime/int: Warnings about using C number types instead of C++ ones
4040
# build/include_subdir: Warnings about prefacing included header files with directory
41+
42+
# We don't lint all C files because we don't want to lint any that are built
43+
# from Cython files nor do we want to lint C files that we didn't modify for
44+
# this particular codebase (e.g. src/headers, src/klib, src/msgpack). However,
45+
# we can lint all header files since they aren't "generated" like C files are.
4146
pip install cpplint
4247

4348
echo "Linting *.c and *.h"
44-
cpplint --extensions=c,h --headers=h --filter=-readability/casting,-runtime/int,-build/include_subdir --recursive pandas/src/parser
45-
if [ $? -ne "0" ]; then
46-
RET=1
47-
fi
49+
for path in '*.h' 'period_helper.c' 'datetime' 'parser' 'ujson'
50+
do
51+
echo "linting -> pandas/src/$path"
52+
cpplint --extensions=c,h --headers=h --filter=-readability/casting,-runtime/int,-build/include_subdir --recursive pandas/src/$path
53+
if [ $? -ne "0" ]; then
54+
RET=1
55+
fi
56+
done
4857
echo "Linting *.c and *.h DONE"
4958

5059
echo "Check for invalid testing"

0 commit comments

Comments
 (0)