Skip to content

Commit 67cfd38

Browse files
authored
Add ruff rules for print (#570)
1 parent 67b3376 commit 67cfd38

File tree

5 files changed

+12
-3
lines changed

5 files changed

+12
-3
lines changed

libs/knowledge-graph/ragstack_knowledge_graph/render.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def print_graph_documents(
2020
for relation in doc.relationships:
2121
source = relation.source
2222
target = relation.target
23-
print(f"{_node_label(source)} -> {_node_label(target)}: {relation.type}")
23+
print(f"{_node_label(source)} -> {_node_label(target)}: {relation.type}") # noqa: T201
2424

2525

2626
def render_graph_documents(

libs/ragulate/colbert_chunk_size_and_k.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# ruff: noqa: T201
12
import logging
23
import os
34
import time

libs/ragulate/open_ai_chunk_size_and_k.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# ruff: noqa: T201
12
import os
23

34
from langchain_astradb import AstraDBVectorStore

libs/ragulate/ragstack_ragulate/pipelines/query_pipeline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def query(self):
222222
err = f"Query: '{query}' caused exception, skipping."
223223
logger.exception(err)
224224
# TODO: figure out why the logger isn't working after tru-lens starts. For now use print(). # noqa: E501
225-
print(f"{err} Exception {e}")
225+
print(f"{err} Exception {e}") # noqa: T201
226226
finally:
227227
self.update_progress(query_change=1)
228228

pyproject.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ select = [
9797
"SIM",
9898
"SLOT",
9999
"T10",
100+
"T20",
100101
"TCH",
101102
"TRY",
102103
"UP",
@@ -105,10 +106,16 @@ select = [
105106
]
106107

107108
[tool.ruff.lint.per-file-ignores]
108-
"**/libs/langchain/*" = [
109+
"libs/langchain/*" = [
109110
"UP006", # Incompatible with Pydantic v1
110111
"UP007", # Incompatible with Pydantic v1
111112
]
113+
"**/{examples,notebooks,tests,e2e-tests}/*" = [
114+
"T20",
115+
]
116+
"scripts/*" = [
117+
"T20",
118+
]
112119

113120
[build-system]
114121
requires = ["poetry-core"]

0 commit comments

Comments
 (0)