Skip to content

Commit

Permalink
Fix docs format to abide to newer docformatter
Browse files Browse the repository at this point in the history
Also pin docformatter to <1.7.1, as it starts misbehaving with :param
entries
  • Loading branch information
BenjaminSchubert committed Dec 29, 2023
1 parent 856d318 commit 3077aa4
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 14 deletions.
6 changes: 5 additions & 1 deletion dwasfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@
description="Show which imports are unnecessary",
)
dwas.register_managed_step(dwas.predefined.isort(files=PYTHON_FILES))
dwas.register_managed_step(dwas.predefined.docformatter(files=PYTHON_FILES))
dwas.register_managed_step(
dwas.predefined.docformatter(files=PYTHON_FILES),
dependencies=["docformatter[tomli]<1.7.1"],
)
dwas.register_managed_step(dwas.predefined.black())
dwas.register_step_group(
"format-check", ["black", "docformatter", "isort", "unimport"]
Expand Down Expand Up @@ -61,6 +64,7 @@
),
name="docformatter:fix",
run_by_default=False,
dependencies=["docformatter[tomli]<1.7.1"],
requires=["isort:fix"],
)
dwas.register_managed_step(
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ recursive = true
make-summary-multi-line = true
pre-summary-newline = true
wrap-summaries = 89
wrap-descriptions = 72

##
# Isort
Expand Down
21 changes: 13 additions & 8 deletions src/dwas/_steps/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,12 @@ def setup_dependent(
"""
Run some logic into a dependent step.
:param original_step: The original step handler that was used when the
step defining this method was called.
:param original_step: The original step handler that was used
when the step defining this method was
called.
:param current_step: The current step handler, that contains the
context of the step that is going to be executed.
context of the step that is going to be
executed.
"""


Expand Down Expand Up @@ -358,10 +360,12 @@ def gather_artifacts(self, step: "StepRunner") -> Dict[str, List[Any]]:
"""
Gather all artifacts exposed by this step.
:param step: The step handler that was used when running the step.
:return: A dictionary of artifact key to a list of arbitrary data.
This **must** return a list, as they are merged with other
steps' artifacts into a single list per artifact key.
:param step: The step handler that was used when running the
step.
:return: A dictionary of artifact key to a list of arbitrary
data. This **must** return a list, as they are merged
with other steps' artifacts into a single list per
artifact key.
"""


Expand Down Expand Up @@ -465,7 +469,8 @@ def cache_path(self) -> Path:
"""
The path to the cache for the current step.
This can be used to store temporary files or any other artifacts.
This can be used to store temporary files or any other
artifacts.
This will be cleaned up and emptied before the step runs.
"""
Expand Down
11 changes: 6 additions & 5 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,13 @@ def ensure_defaults_are_untouched(tmp_path_factory):
"""
Ensure that the defaults values for predefined steps are not mutated.
The predefined steps set some defaults that might be mutable, e.g. lists.
We need to take special care to ensure we do not modify them at runtime so
that the steps are reusable.
The predefined steps set some defaults that might be mutable, e.g.
lists. We need to take special care to ensure we do not modify them
at runtime so that the steps are reusable.
This loads all the steps before anything runs, and deep copies the defaults.
It then validates that they did not change at the end of the run.
This loads all the steps before anything runs, and deep copies the
defaults. It then validates that they did not change at the end of
the run.
"""
steps = {}

Expand Down

0 comments on commit 3077aa4

Please sign in to comment.