Skip to content

Commit

Permalink
ci: ensure docstrings are formatted (#156)
Browse files Browse the repository at this point in the history
* ci: ensure docstrings are formatted

Signed-off-by: nstarman <[email protected]>

* fix: docs

Signed-off-by: nstarman <[email protected]>

---------

Signed-off-by: nstarman <[email protected]>
  • Loading branch information
nstarman authored Jun 11, 2024
1 parent e2f8961 commit 6dcb9f1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
12 changes: 11 additions & 1 deletion plum/parametric.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@ def __init_type_parameter__(cls, *ps) -> tuple:
@classmethod
def __le_type_parameter__(cls, left, right) -> bool:
... # Is `left <= right`?
# Is `left <= right`?
...
"""

original_meta = type(original_class)
Expand Down Expand Up @@ -307,8 +309,10 @@ def __class_nonparametric__(cls):
... @classmethod
... def __infer_type_parameter__(cls, *arg):
... return type(arg[0])
...
... def __init__(self, x):
... self.x = x
...
... def __repr__(self):
... return f"Obj({self.x})"
>>> PObj = parametric(Obj)
Expand Down Expand Up @@ -357,8 +361,10 @@ def __class_unparametrized__(cls):
... @classmethod
... def __infer_type_parameter__(cls, *arg):
... return type(arg[0])
...
... def __init__(self, x):
... self.x = x
...
... def __repr__(self):
... return f"Obj({self.x})"
>>> PObj = parametric(Obj)
Expand Down Expand Up @@ -491,8 +497,10 @@ def type_nonparametric(q: T) -> Type[T]:
... @classmethod
... def __infer_type_parameter__(cls, *arg):
... return type(arg[0])
...
... def __init__(self, x):
... self.x = x
...
... def __repr__(self):
... return f"Obj({self.x})"
>>> PObj = parametric(Obj)
Expand Down Expand Up @@ -557,8 +565,10 @@ def type_unparametrized(q: T) -> Type[T]:
... @classmethod
... def __infer_type_parameter__(cls, *arg):
... return type(arg[0])
...
... def __init__(self, x):
... self.x = x
...
... def __repr__(self):
... return f"Obj({self.x})"
>>> PObj = parametric(Obj)
Expand Down
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,17 @@ line-length = 88
select = [
"B", # flake8-bugbear
"D410",
"E", # pycodestyle
"E", "W", # pycodestyle
"F", # Pyflakes
"I", # isort
"SIM", # flake8-simplify
"UP", # pyupgrade
"W",
]
ignore = ["F811", "B018"]

[tool.ruff.lint.isort]
known-first-party = ["beartype"]
known-local-folder = ["plum"]

[tool.ruff.format]
docstring-code-format = true

0 comments on commit 6dcb9f1

Please sign in to comment.