Skip to content
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

text-splitters: add pydocstyle linting #28127

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

dangiankit
Copy link

As seen in #23188, turned on Google-style docstrings by enabling pydocstyle linting in the text-splitters package. Each resulting linting error was addressed differently: ignored, resolved, suppressed, and missing docstrings were added.

Fixes one of the checklist items from #25154, similar to #25939 in core package. Ran make format, make lint and make test from the root of the package text-splitters to ensure no issues were found.

Added a `# noqa: D100` directive to suppress the missing module docstring
error for the `__future__` annotations import. This resolves the linter
issue while maintaining compliance with pydocstyle.
Fixed the following pydocstyle issues:
- D202: Removed blank lines following function docstrings.
- D205: Added a blank line between the summary line and description.
- D209: Ensured multi-line docstring closing quotes are on a separate line.
- D212: Adjusted multi-line docstring summary to start on the first line.
- D212: Ensured multi-line docstring summaries start on the first line.
- D415: Updated the first line of docstrings to end with a period, question mark, or exclamation point.

These changes align the code with PEP 257 guidelines and improve docstring consistency.
…or `__init__`

Resolved the following pydocstyle errors:
- D107: Added a docstring to the `__init__` method to describe its purpose.
- D417: Included a description for the `**kwargs` argument in the `__init__` docstring.

These changes ensure compliance with PEP 257 and improve code clarity by documenting
the constructor and its parameters.
Added a docstring to address the `D101` pydocstyle error, documenting the purpose
and functionality of the affected public class. This ensures compliance with PEP 257
and improves code clarity.
Added missing docstrings to public methods to resolve `D102` pydocstyle errors.
These updates ensure compliance with PEP 257 and improve code documentation
and readability.
Added `# type: ignore[attr-defined]` to suppress the `mypy` error: "PageElement"
has no attribute 'name'. This fix resolves the immediate issue while maintaining
compatibility with BeautifulSoup and ensuring the code passes type checks.
Copy link

vercel bot commented Nov 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Nov 15, 2024 7:29am

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. Ɑ: text splitters Related to text splitters package 🤖:nit Small modifications/deletions, fixes, deps or improvements to existing code or docs labels Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:nit Small modifications/deletions, fixes, deps or improvements to existing code or docs size:L This PR changes 100-499 lines, ignoring generated files. Ɑ: text splitters Related to text splitters package
Projects
Status: Triage
Development

Successfully merging this pull request may close these issues.

1 participant