From 2b5a9a284d10797b8170b69ed2339868ed89cc91 Mon Sep 17 00:00:00 2001 From: Jarrod Millman Date: Wed, 1 Feb 2023 10:57:48 -0800 Subject: [PATCH 1/2] Update pre-commit --- .pre-commit-config.yaml | 8 ++++---- requirements/developer.txt | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 611379ed..900c354a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.4.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -17,7 +17,7 @@ repos: - id: check-added-large-files - repo: https://github.com/psf/black - rev: 22.8.0 + rev: 23.1.0 hooks: - id: black @@ -29,12 +29,12 @@ repos: args: [--prose-wrap=preserve] - repo: https://github.com/asottile/blacken-docs - rev: v1.12.1 + rev: 1.13.0 hooks: - id: blacken-docs - repo: https://github.com/asottile/pyupgrade - rev: v2.38.2 + rev: v3.3.1 hooks: - id: pyupgrade args: [--py37-plus] diff --git a/requirements/developer.txt b/requirements/developer.txt index db79816f..b8de207e 100644 --- a/requirements/developer.txt +++ b/requirements/developer.txt @@ -1 +1 @@ -pre-commit>=2.20 +pre-commit>=3.0 From ae99710477ec73c0e165bfc296925c60f1eab9a6 Mon Sep 17 00:00:00 2001 From: Jarrod Millman Date: Wed, 1 Feb 2023 11:03:04 -0800 Subject: [PATCH 2/2] Run pre-commit on all files --- numpydoc/docscrape.py | 3 +-- numpydoc/tests/test_docscrape.py | 1 - numpydoc/tests/test_validate.py | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/numpydoc/docscrape.py b/numpydoc/docscrape.py index e5c07f59..150325f3 100644 --- a/numpydoc/docscrape.py +++ b/numpydoc/docscrape.py @@ -408,7 +408,7 @@ def _parse(self): msg = "Docstring contains a Receives section but not Yields." raise ValueError(msg) - for (section, content) in sections: + for section, content in sections: if not section.startswith(".."): section = (s.capitalize() for s in section.split(" ")) section = " ".join(section) @@ -631,7 +631,6 @@ def __init__(self, obj, doc=None, config=None): class ClassDoc(NumpyDocString): - extra_public_methods = ["__call__"] def __init__(self, cls, doc=None, modulename="", func_doc=FunctionDoc, config=None): diff --git a/numpydoc/tests/test_docscrape.py b/numpydoc/tests/test_docscrape.py index 227f8724..73dea61d 100644 --- a/numpydoc/tests/test_docscrape.py +++ b/numpydoc/tests/test_docscrape.py @@ -1443,7 +1443,6 @@ def __set__(self, obj, value): obj._set_axis(self.axis, value) class Dummy: - attr = SpecialProperty(doc="test attribute") doc = get_doc_object(Dummy) diff --git a/numpydoc/tests/test_validate.py b/numpydoc/tests/test_validate.py index 87daee17..f01cde50 100644 --- a/numpydoc/tests/test_validate.py +++ b/numpydoc/tests/test_validate.py @@ -545,7 +545,6 @@ class BadGenericDocStrings: """Everything here has a bad docstring""" def func(self): - """Some function. With several mistakes in the docstring.