Skip to content

Commit 8325caf

Browse files
committed
Add flake8-rst
Added flake8-rst as development dependency Added flake8-rst configuration Added checks to code_checks.sh Signed-off-by: Fabian Haase <[email protected]>
1 parent 9285820 commit 8325caf

5 files changed

+24
-2
lines changed

ci/code_checks.sh

+15-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# $ ./ci/code_checks.sh doctests # run doctests
1616

1717
echo "inside $0"
18-
[[ $LINT ]] || { echo "NOT Linting. To lint use: LINT=true $0 $1"; exit 0; }
18+
[[ $LINT || $1 ]] || { echo "NOT Linting. To lint use: LINT=true $0 $1"; exit 0; }
1919
[[ -z "$1" || "$1" == "lint" || "$1" == "patterns" || "$1" == "doctests" ]] || { echo "Unkown command $1. Usage: $0 [lint|patterns|doctests]"; exit 9999; }
2020

2121
source activate pandas
@@ -44,6 +44,17 @@ if [[ -z "$CHECK" || "$CHECK" == "lint" ]]; then
4444
flake8 pandas/_libs --filename=*.pxi.in,*.pxd --select=E501,E302,E203,E111,E114,E221,E303,E231,E126,F403
4545
RET=$(($RET + $?)) ; echo $MSG "DONE"
4646

47+
echo "flake8-rst --version"
48+
flake8-rst --version
49+
50+
MSG='Linting code-blocks in .py docstrings' ; echo $MSG
51+
flake8-rst pandas
52+
RET=$(($RET + $?)) ; echo $MSG "DONE"
53+
54+
MSG='Linting code-blocks in .rst documentation' ; echo $MSG
55+
flake8-rst doc --filename=*.rst
56+
RET=$(($RET + $?)) ; echo $MSG "DONE"
57+
4758
# readability/casting: Warnings about C casting instead of C++ casting
4859
# runtime/int: Warnings about using C number types instead of C++ ones
4960
# build/include_subdir: Warnings about prefacing included header files with directory
@@ -56,6 +67,9 @@ if [[ -z "$CHECK" || "$CHECK" == "lint" ]]; then
5667
cpplint --quiet --extensions=c,h --headers=h --recursive --filter=-readability/casting,-runtime/int,-build/include_subdir pandas/_libs/src/*.h pandas/_libs/src/parser pandas/_libs/ujson pandas/_libs/tslibs/src/datetime
5768
RET=$(($RET + $?)) ; echo $MSG "DONE"
5869

70+
echo "isort --version-number"
71+
isort --version-number
72+
5973
# Imports - Check formatting using isort see setup.cfg for settings
6074
MSG='Check import format using isort ' ; echo $MSG
6175
isort --recursive --check-only pandas

ci/environment-dev.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ dependencies:
77
- NumPy
88
- flake8
99
- flake8-comprehensions
10+
- flake8-rst
1011
- hypothesis>=3.58.0
1112
- isort
1213
- moto

ci/requirements-optional-pip.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ numexpr>=2.6.1
1717
openpyxl==2.5.5
1818
pyarrow
1919
pymysql
20-
tables
20+
pytables>=3.4.2
2121
pytest-cov
2222
pytest-xdist
2323
s3fs

ci/requirements_dev.txt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Cython>=0.28.2
44
NumPy
55
flake8
66
flake8-comprehensions
7+
flake8-rst
78
hypothesis>=3.58.0
89
isort
910
moto

setup.cfg

+6
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ exclude =
2929
doc/temp/*.py,
3030
.eggs/*.py,
3131
versioneer.py
32+
.tox
33+
34+
[flake8-rst]
35+
bootstrap =
36+
import pandas as pd
37+
import numpy as np
3238

3339
[yapf]
3440
based_on_style = pep8

0 commit comments

Comments
 (0)