Skip to content

Commit f8c1b43

Browse files
authored
add missing information to docstrings (#12)
1 parent 2a30747 commit f8c1b43

File tree

4 files changed

+34
-4
lines changed

4 files changed

+34
-4
lines changed

flake8_test_docs.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,15 @@ def _append_invalid_msg_prefix_postfix(
100100

101101
@wraps(func)
102102
def wrapper(*args: AIMPPParamSpec.args, **kwargs: AIMPPParamSpec.kwargs) -> str | None:
103-
"""Wrap the function."""
103+
"""Wrap the function.
104+
105+
Args:
106+
args: The function arguments.
107+
kwargs: The function kwargs.
108+
109+
Returns:
110+
The function return value with the code and postfix added.
111+
"""
104112
if (return_value := func(*args, **kwargs)) is None:
105113
return None
106114
return f"{INVALID_CODE} {return_value}{INVALID_MSG_POSTFIX}"
@@ -316,7 +324,13 @@ class Visitor(ast.NodeVisitor):
316324
def __init__(
317325
self, test_docs_pattern: DocsPattern, test_function_pattern: str, indent_size: int
318326
) -> None:
319-
"""Construct."""
327+
"""Construct.
328+
329+
Args:
330+
test_docs_pattern: The pattern to identify test files with.
331+
test_function_pattern: The pattern to identify test functions with.
332+
indent_size: The number of spaces in indentation.
333+
"""
320334
self.problems = []
321335
self._test_docs_pattern = test_docs_pattern
322336
self._test_function_pattern = test_function_pattern
@@ -364,7 +378,6 @@ class Plugin:
364378
365379
Attrs:
366380
name: The name of the plugin.
367-
version: The version of the plugin.
368381
"""
369382

370383
name = __name__

poetry.lock

Lines changed: 16 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ pydocstyle = "^6"
4040
toml = "^0"
4141
astpretty = "^3"
4242
hypothesis = "^6"
43+
flake8-docstrings-complete = "^1.0.0"
4344

4445
[build-system]
4546
requires = ["poetry-core"]

tests/test_flake8_test_docs_unit.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def _result(code: str, filename: str = "test_.py") -> tuple[str, ...]:
2424
2525
Args:
2626
code: The code to check.
27+
filename: The name of the file being checked.
2728
2829
Returns:
2930
The linting result.

0 commit comments

Comments
 (0)