Skip to content

Change docs to a new format - #2528

Open
Khabib73 wants to merge 5 commits into
dry-python:masterfrom
Khabib73:feat/update-codebase
Open

Khabib73 wants to merge 5 commits into
dry-python:masterfrom
Khabib73:feat/update-codebase

Conversation

@Khabib73

@Khabib73 Khabib73 commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Closes #2527

@codspeed

codspeed Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 22 untouched benchmarks


Comparing Khabib73:feat/update-codebase (0db03f1) with master (1739834)

Open in CodSpeed

@codecov

codecov Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (82ef3ef) to head (0db03f1).
⚠️ Report is 624 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##            master     #2528    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           80        81     +1     
  Lines         2485      2684   +199     
  Branches       437        44   -393     
==========================================
+ Hits          2485      2684   +199     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Khabib73
Khabib73 marked this pull request as ready for review October 7, 2026 09:56
@Khabib73

Khabib73 commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Should we add this into CONTRIBUTING?


Documentation

We document all module-level values
with a docstring right after the assignment:

MAX_RETRIES: Final = 3
"""Maximum number of retries for a single request."""

See also

https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#doc-comments-and-docstrings

)
from returns.context.requires_context_result import RequiresContextResult

# Context:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are comments, not docs :)



# Type Aliases:
#: Sometimes ``RequiresContext`` and other similar types might be used with

Copy link
Copy Markdown
Member

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

#: This field has an extra 'RequiresContext' just because `mypy` needs it.
_inner_value: Callable[[_EnvType_contra], _ReturnType_co]
"""
This field has an extra 'RequiresContext'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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, . in the end.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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:

"""
This field has an extra 'RequiresContext'
just because `mypy` needs it."""

But you want it to follow the docstring convention?

"""This field has an extra 'RequiresContext' just because `mypy` needs it."""

I understand the concern about the 80-character line limit. How should we handle longer docstrings that exceed this limit?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same style of docs that we use for docstrings

What is the rule (WPS code)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a ruff rule:

D415 First line should end with a period, question mark, or exclamation point
 --> ex.py:2:5
  |
1 | def some():
2 |     """Ss"""
  |     ^^^^^^^^
help: Add closing punctuation

and

D205 1 blank line required between summary line and description
 --> ex.py:2:5
  |
1 |   def some():
2 | /     """First line
3 | |     second line
4 | |     """
  | |_______^
help: Insert single blank line

D415 First line should end with a period, question mark, or exclamation point
 --> ex.py:2:5
  |
1 |   def some():
2 | /     """First line
3 | |     second line
4 | |     """
  | |_______^
help: Add closing punctuation

But, these rules are not enforced for attr-level docs. This should be proposed and fixed in ruff :)

)
from returns.context.requires_context_result import RequiresContextResult

# Context:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. Please, revert :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

WPS 1.9.0

2 participants