Skip to content

Commit 9158000

Browse files
Amnah199julian-risch
authored andcommitted
chore: update linter configuration for compatibility with latest ruff release (#9528)
* Fix linting * Fix linting * Update error suppression * Update pre commit * Update pyproject.toml
1 parent cb1600f commit 9158000

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ repos:
1717
args: [--markdown-linebreak-ext=md]
1818

1919
- repo: https://github.com/astral-sh/ruff-pre-commit
20-
rev: v0.11.0
20+
rev: v0.12.0
2121
hooks:
2222
- id: ruff
2323
- id: ruff-format

haystack/core/component/sockets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
SocketsIOType = Union[Type[InputSocket], Type[OutputSocket]]
1313

1414

15-
class Sockets:
15+
class Sockets: # noqa: PLW1641
1616
"""
1717
Represents the inputs or outputs of a `Component`.
1818

haystack/core/pipeline/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class ComponentPriority(IntEnum):
7171
BLOCKED = 5
7272

7373

74-
class PipelineBase:
74+
class PipelineBase: # noqa: PLW1641
7575
"""
7676
Components orchestration engine.
7777

haystack/dataclasses/document.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def __call__(cls, *args, **kwargs):
4343

4444

4545
@dataclass
46-
class Document(metaclass=_BackwardCompatible):
46+
class Document(metaclass=_BackwardCompatible): # noqa: PLW1641
4747
"""
4848
Base data class containing some data to be queried.
4949

pyproject.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ dependencies = [
9090
"pandas", # AzureOCRDocumentConverter, CSVDocumentCleaner, CSVDocumentSplitter,
9191
# EvaluationRunResult, XLSXToDocument, and pipeline tests
9292

93-
"transformers[torch,sentencepiece]>=4.51.1,<4.52", # ExtractiveReader, TransformersSimilarityRanker, LocalWhisperTranscriber, HFGenerators...
93+
"transformers[torch, sentencepiece]>=4.51.1,<4.52", # ExtractiveReader, TransformersSimilarityRanker, LocalWhisperTranscriber, HFGenerators...
9494
"huggingface_hub>=0.27.0", # Hugging Face API Generators and Embedders
9595
"sentence-transformers>=4.1.0", # Sentence Transformers Embedders, Rankers, and SASEvaluator
9696
"langdetect", # TextLanguageRouter and DocumentLanguageClassifier
@@ -342,6 +342,10 @@ ignore = [
342342
"SIM108", # if-else-block-instead-of-if-exp
343343
"SIM115", # open-file-with-context-handler
344344
"SIM118", # in-dict-keys
345+
# we re-export symbols for correct type checking
346+
# https://typing.python.org/en/latest/spec/distributing.html#import-conventions
347+
"PLC0414", # useless-import-alias,
348+
"PLC0415", # import-outside-top-level,
345349
]
346350

347351
[tool.ruff.lint.mccabe]

0 commit comments

Comments
 (0)