Repository navigation
Change docs to a new format #2528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,9 +35,12 @@ | |
| _FirstType = TypeVar('_FirstType') | ||
|
|
||
| # Type Aliases: | ||
| #: Sometimes ``RequiresContext`` and other similar types might be used with | ||
| #: no explicit dependencies so we need to have this type alias for Any. | ||
| NoDeps = Any | ||
| """ | ||
| Sometimes ``RequiresContext`` and other similar types | ||
| might be used with no explicit dependencies so we need to | ||
| have this type alias for Any. | ||
| """ | ||
|
|
||
|
|
||
| @final | ||
|
|
@@ -78,11 +81,13 @@ class RequiresContext( # type: ignore[type-var] | |
|
|
||
| __slots__ = () | ||
|
|
||
| #: This field has an extra 'RequiresContext' just because `mypy` needs it. | ||
| _inner_value: Callable[[_EnvType_contra], _ReturnType_co] | ||
| """ | ||
| This field has an extra 'RequiresContext' | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please, open a new issue in WPS: we must enforce the same style of docs that we use for docstrings. One line,
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for the clarification! So you mean the formatting style itself. Currently I have: But you want it to follow the docstring convention? I understand the concern about the 80-character line limit. How should we handle longer docstrings that exceed this limit?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
What is the rule (WPS code)?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm a bit confused :)
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a and But, these rules are not enforced for attr-level docs. This should be proposed and fixed in ruff :) |
||
| just because `mypy` needs it.""" | ||
|
|
||
| #: A convenient placeholder to call methods created by `.from_value()`: | ||
| no_args: ClassVar[NoDeps] = object() | ||
| """A convenient placeholder to call methods created by `.from_value()`.""" | ||
|
|
||
| def __init__( | ||
| self, | ||
|
|
@@ -208,8 +213,8 @@ def bind( | |
| """ | ||
| return RequiresContext(lambda deps: dekind(function(self(deps)))(deps)) | ||
|
|
||
| #: Alias for `bind_context` method, it is the same as `bind` here. | ||
| bind_context = bind | ||
| """Alias for `bind_context` method, it is the same as `bind` here.""" | ||
|
|
||
| def modify_env( | ||
| self, | ||
|
|
@@ -445,5 +450,5 @@ def from_requires_context_future_result( | |
|
|
||
| # Aliases | ||
|
|
||
| #: Sometimes `RequiresContext` is too long to type. | ||
| Reader: TypeAlias = RequiresContext | ||
| """Sometimes `RequiresContext` is too long to type.""" | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, conver this to comments