Skip to content

feat(langchain): add ruff rules PL #32079

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

Merged
merged 1 commit into from
Jul 23, 2025

Conversation

cbornet
Copy link
Collaborator

@cbornet cbornet commented Jul 17, 2025

Copy link

vercel bot commented Jul 17, 2025

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 Jul 22, 2025 8:41am

Copy link

codspeed-hq bot commented Jul 17, 2025

CodSpeed WallTime Performance Report

Merging #32079 will not alter performance

Comparing cbornet:langchain-ruff-pl (b5ef32e) with master (2104cf0)

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

Summary

✅ 13 untouched benchmarks

@cbornet cbornet force-pushed the langchain-ruff-pl branch from 4e1f999 to 112a284 Compare July 17, 2025 09:18
@@ -87,7 +87,7 @@ def __init__(self, *args: Any, **kwargs: Any):
)
from langchain.chains.hyde.base import HypotheticalDocumentEmbedder as H

return H(*args, **kwargs) # type: ignore[return-value]
return H(*args, **kwargs) # type: ignore[return-value] # noqa: PLE0101
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will be fixed by #32078

Copy link

codspeed-hq bot commented Jul 17, 2025

CodSpeed Instrumentation Performance Report

Merging #32079 will not alter performance

Comparing cbornet:langchain-ruff-pl (b5ef32e) with master (2104cf0)

Summary

✅ 14 untouched benchmarks

@@ -89,7 +89,6 @@ def _infer_model_and_provider(
if provider is None and ":" in model:
provider, model_name = _parse_model_string(model)
else:
provider = provider
Copy link
Collaborator

Choose a reason for hiding this comment

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

?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This line was useless

@@ -10,6 +10,8 @@ class AnyStr(str):
def __eq__(self, other: object) -> bool:
return isinstance(other, str)

__hash__ = str.__hash__
Copy link
Collaborator

Choose a reason for hiding this comment

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

?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@cbornet cbornet force-pushed the langchain-ruff-pl branch from 112a284 to 1cfe00d Compare July 17, 2025 15:10
@cbornet cbornet force-pushed the langchain-ruff-pl branch from 1cfe00d to b5ef32e Compare July 22, 2025 08:40
"C4", # flake8-comprehensions
"COM", # flake8-commas
"D", # pydocstyle
"DOC", # pydoclint
Copy link
Collaborator

Choose a reason for hiding this comment

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

what happened to DOC?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

DOC is currently a preview rule.
There’s no point in activating it as we don’t run with the —preview flag.
And we get a warning about it when running the lint.

@mdrxy mdrxy added the linting Linting or formatting label Jul 22, 2025
@mdrxy mdrxy merged commit 3496e17 into langchain-ai:master Jul 23, 2025
29 checks passed
@cbornet cbornet deleted the langchain-ruff-pl branch July 23, 2025 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linting Linting or formatting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants