Skip to content

Commit

Permalink
Add ruff rules for print (#570)
Browse files Browse the repository at this point in the history
  • Loading branch information
cbornet authored Jul 4, 2024
1 parent 67b3376 commit 67cfd38
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libs/knowledge-graph/ragstack_knowledge_graph/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def print_graph_documents(
for relation in doc.relationships:
source = relation.source
target = relation.target
print(f"{_node_label(source)} -> {_node_label(target)}: {relation.type}")
print(f"{_node_label(source)} -> {_node_label(target)}: {relation.type}") # noqa: T201


def render_graph_documents(
Expand Down
1 change: 1 addition & 0 deletions libs/ragulate/colbert_chunk_size_and_k.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ruff: noqa: T201
import logging
import os
import time
Expand Down
1 change: 1 addition & 0 deletions libs/ragulate/open_ai_chunk_size_and_k.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ruff: noqa: T201
import os

from langchain_astradb import AstraDBVectorStore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def query(self):
err = f"Query: '{query}' caused exception, skipping."
logger.exception(err)
# TODO: figure out why the logger isn't working after tru-lens starts. For now use print(). # noqa: E501
print(f"{err} Exception {e}")
print(f"{err} Exception {e}") # noqa: T201
finally:
self.update_progress(query_change=1)

Expand Down
9 changes: 8 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ select = [
"SIM",
"SLOT",
"T10",
"T20",
"TCH",
"TRY",
"UP",
Expand All @@ -105,10 +106,16 @@ select = [
]

[tool.ruff.lint.per-file-ignores]
"**/libs/langchain/*" = [
"libs/langchain/*" = [
"UP006", # Incompatible with Pydantic v1
"UP007", # Incompatible with Pydantic v1
]
"**/{examples,notebooks,tests,e2e-tests}/*" = [
"T20",
]
"scripts/*" = [
"T20",
]

[build-system]
requires = ["poetry-core"]
Expand Down

0 comments on commit 67cfd38

Please sign in to comment.