Skip to content

Commit 0efaa48

Browse files
authored
langchain-groq[patch]: Add ruff bandit rules to linter (#31797)
- Add ruff bandit rules - Address s105 errors
1 parent 479b6fd commit 0efaa48

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

libs/partners/groq/pyproject.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ disallow_untyped_defs = "True"
4444
target-version = "py39"
4545

4646
[tool.ruff.lint]
47-
select = ["E", "F", "I", "W", "UP"]
47+
select = ["E", "F", "I", "W", "UP", "S"]
4848
ignore = [ "UP007", ]
4949

5050
[tool.coverage.run]
@@ -57,3 +57,9 @@ markers = [
5757
"scheduled: mark tests to run in scheduled testing",
5858
]
5959
asyncio_mode = "auto"
60+
61+
[tool.ruff.lint.extend-per-file-ignores]
62+
"tests/**/*.py" = [
63+
"S101", # Tests need assertions
64+
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes
65+
]

libs/partners/groq/tests/unit_tests/test_chat_models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,8 @@ def test_chat_groq_invalid_streaming_params() -> None:
245245

246246
def test_chat_groq_secret() -> None:
247247
"""Test that secret is not printed"""
248-
secret = "secretKey"
249-
not_secret = "safe"
248+
secret = "secretKey" # noqa: S105
249+
not_secret = "safe" # noqa: S105
250250
llm = ChatGroq(model="foo", api_key=secret, model_kwargs={"not_secret": not_secret}) # type: ignore[call-arg, arg-type]
251251
stringified = str(llm)
252252
assert not_secret in stringified

0 commit comments

Comments
 (0)