Skip to content

Commit 979dcca

Browse files
CI: add pydocstyle to code_checks
1 parent 3118576 commit 979dcca

File tree

6 files changed

+10
-5
lines changed

6 files changed

+10
-5
lines changed

ci/code_checks.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,11 @@ fi
316316
### DOCSTRINGS ###
317317
if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
318318

319+
320+
MSG='Validate docstrings (D201, D202, D204, D207, D208, D209, D213, D300, D409, D411, D412, D414)' ; echo $MSG
321+
pydocstyle pandas --select=D201,D202,D204,D207,D208,D209,D213,D300,D409,D411,D412,D414
322+
RET=$(($RET + $?)) ; echo $MSG "DONE"
323+
319324
MSG='Validate docstrings (GL03, GL04, GL05, GL06, GL07, GL09, GL10, SS04, SS05, PR03, PR04, PR05, PR10, EX04, RT01, RT04, RT05, SA02, SA03, SA05)' ; echo $MSG
320325
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=GL03,GL04,GL05,GL06,GL07,GL09,GL10,SS04,SS05,PR03,PR04,PR05,PR10,EX04,RT01,RT04,RT05,SA02,SA03,SA05
321326
RET=$(($RET + $?)) ; echo $MSG "DONE"

environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ dependencies:
2323
- isort # check that imports are in the right order
2424
- mypy=0.730
2525
- pycodestyle # used by flake8
26+
- pydocstyle
2627

2728
# documentation
2829
- gitpython # obtain contributors from git for whatsnew

pandas/core/arrays/datetimes.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,6 @@ def __iter__(self):
559559
------
560560
tstamp : Timestamp
561561
"""
562-
563562
# convert in chunks of 10k for efficiency
564563
data = self.asi8
565564
length = len(self)
@@ -820,7 +819,7 @@ def tz_convert(self, tz):
820819
dtype = tz_to_dtype(tz)
821820
return self._simple_new(self.asi8, dtype=dtype, freq=self.freq)
822821

823-
def tz_localize(self, tz, ambiguous="raise", nonexistent="raise"):
822+
def tz_localize(self, tz, ambiguous="raise", nonexistent="raise"): # noqa
824823
"""
825824
Localize tz-naive Datetime Array/Index to tz-aware
826825
Datetime Array/Index.
@@ -1640,7 +1639,6 @@ def to_julian_date(self):
16401639
0 Julian date is noon January 1, 4713 BC.
16411640
https://en.wikipedia.org/wiki/Julian_day
16421641
"""
1643-
16441642
# http://mysite.verizon.net/aesir_research/date/jdalg2.htm
16451643
year = np.asarray(self.year)
16461644
month = np.asarray(self.month)
@@ -1705,7 +1703,6 @@ def sequence_to_dt64ns(
17051703
------
17061704
TypeError : PeriodDType data is passed
17071705
"""
1708-
17091706
inferred_freq = None
17101707

17111708
dtype = _validate_dt64_dtype(dtype)

pandas/core/tools/datetimes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ def to_datetime(
538538
infer_datetime_format=False,
539539
origin="unix",
540540
cache=True,
541-
):
541+
): # noqa: D207
542542
"""
543543
Convert argument to datetime.
544544

pandas/io/excel/_openpyxl.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ def _convert_to_protection(cls, protection_dict):
393393
394394
Returns
395395
-------
396+
openpyxl.styles.Protection
396397
"""
397398
from openpyxl.styles import Protection
398399

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ flake8-rst>=0.6.0,<=0.7.0
1414
isort
1515
mypy==0.730
1616
pycodestyle
17+
pydocstyle
1718
gitpython
1819
sphinx
1920
nbconvert>=5.4.1

0 commit comments

Comments
 (0)