From ae96b50e164d94a4c5b08fcdfd031c2118dd8e0e Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Sat, 27 Apr 2019 14:38:46 +0200 Subject: [PATCH] Add pydocstyle checks to flake8 --- .flake8 | 7 +++++++ lib/matplotlib/_constrained_layout.py | 1 - lib/matplotlib/axis.py | 1 - lib/matplotlib/bezier.py | 1 - lib/matplotlib/image.py | 1 - lib/matplotlib/widgets.py | 1 - requirements/testing/travis_flake8.txt | 1 + 7 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.flake8 b/.flake8 index aa7c8e5dd2ed..d3205f838aa8 100644 --- a/.flake8 +++ b/.flake8 @@ -10,6 +10,13 @@ ignore = F401, F403, F811, F841, # Some new flake8 ignores: N801, N802, N803, N806, N812, + # pydocstyle + D100, D101, D102, D103, D104, D105, D106, D107, + D200, D202, D203, D204, D205, D207, D208, D209, + D210, D211, D212, D213, D214, D215, + D300, D301, D302, + D400, D401, D402, D403, D404, D405, D406, D407, D408, D409, + D410, D411, D412, D413, D414, exclude = .git diff --git a/lib/matplotlib/_constrained_layout.py b/lib/matplotlib/_constrained_layout.py index 130c41169213..f8f929c6b75c 100644 --- a/lib/matplotlib/_constrained_layout.py +++ b/lib/matplotlib/_constrained_layout.py @@ -81,7 +81,6 @@ def _axes_all_finite_sized(fig): ###################################################### def do_constrained_layout(fig, renderer, h_pad, w_pad, hspace=None, wspace=None): - """ Do the constrained_layout. Called at draw time in ``figure.constrained_layout()`` diff --git a/lib/matplotlib/axis.py b/lib/matplotlib/axis.py index 5f462860bd3d..7f83ab15d944 100644 --- a/lib/matplotlib/axis.py +++ b/lib/matplotlib/axis.py @@ -440,7 +440,6 @@ def _get_text1(self): return t def _get_text2(self): - 'Get the default Text 2 instance' # x in data coords, y in axes coords trans, vert, horiz = self._get_text2_transform() diff --git a/lib/matplotlib/bezier.py b/lib/matplotlib/bezier.py index c974787583e8..3f4639c4867f 100644 --- a/lib/matplotlib/bezier.py +++ b/lib/matplotlib/bezier.py @@ -180,7 +180,6 @@ def point_at_t(self, t): @cbook._rename_parameter("3.1", "tolerence", "tolerance") def split_bezier_intersecting_with_closedpath( bezier, inside_closedpath, tolerance=0.01): - """ bezier : control points of the bezier segment inside_closedpath : a function which returns true if the point is inside diff --git a/lib/matplotlib/image.py b/lib/matplotlib/image.py index 03b651edafb8..5b1a78c8b9ea 100644 --- a/lib/matplotlib/image.py +++ b/lib/matplotlib/image.py @@ -818,7 +818,6 @@ def __init__(self, ax, resample=False, **kwargs ): - """ interpolation and cmap default to their rc settings diff --git a/lib/matplotlib/widgets.py b/lib/matplotlib/widgets.py index 0a884651ff69..35d8d679429d 100644 --- a/lib/matplotlib/widgets.py +++ b/lib/matplotlib/widgets.py @@ -2014,7 +2014,6 @@ def __init__(self, ax, onselect, drawtype='box', lineprops=None, rectprops=None, spancoords='data', button=None, maxdist=10, marker_props=None, interactive=False, state_modifier_keys=None): - """ Create a selector in *ax*. When a selection is made, clear the span and call onselect with:: diff --git a/requirements/testing/travis_flake8.txt b/requirements/testing/travis_flake8.txt index da52d6741973..77e992244280 100644 --- a/requirements/testing/travis_flake8.txt +++ b/requirements/testing/travis_flake8.txt @@ -1,3 +1,4 @@ # Extra pip requirements for the travis flake8 build flake8>=3.7 +flake8-docstrings