diff --git a/.github/workflows/docstrings_linting.yml b/.github/workflows/docstrings_linting.yml new file mode 100644 index 000000000..80cee5cf1 --- /dev/null +++ b/.github/workflows/docstrings_linting.yml @@ -0,0 +1,20 @@ +name: run docstrings linting + +on: + push: + branches: + - docstrings-linting + +jobs: + docstrings-linting: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Hatch + run: pip install hatch=="1.9.3" + + - name: ruff docstrings linting + run: hatch run ruff check haystack diff --git a/haystack/core/pipeline/pipeline.py b/haystack/core/pipeline/pipeline.py index cae99da2f..b72914818 100644 --- a/haystack/core/pipeline/pipeline.py +++ b/haystack/core/pipeline/pipeline.py @@ -851,7 +851,7 @@ class Pipeline: }, ) as span: span.set_content_tag("haystack.component.input", last_inputs[name]) - + logger.info("Running component {name}", name=name) logger.info("Running component {component_name}", component_name=name) res = comp.run(**last_inputs[name]) self.graph.nodes[name]["visits"] += 1 diff --git a/pyproject.toml b/pyproject.toml index 3c3833c8e..fca478aac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -296,14 +296,14 @@ ignore_missing_imports = true [tool.ruff] line-length = 301 target-version = "py38" +exclude= ["test"] + [tool.ruff.lint] select = [ - "AIR", # Airflow "ASYNC", # flake8-async "C4", # flake8-comprehensions "C90", # McCabe cyclomatic complexity - "DJ", # flake8-django "E501", # Long lines "EXE", # flake8-executable "F", # Pyflakes @@ -316,12 +316,19 @@ select = [ "T10", # flake8-debugger "W", # pycodestyle "YTT", # flake8-2020 - "I" # isort - # "E", # pycodestyle - # "NPY", # NumPy-specific rules - # "PD", # pandas-vet - # "PT", # flake8-pytest-style - # "UP", # pyupgrade + "I", # isort + # built-in shadowing + "A001", # builtin-variable-shadowing + "A002", # builtin-argument-shadowing + "A003", # builtin-attribute-shadowing + # docstring rules + "D102", # Missing docstring in public method + "D103", # Missing docstring in public function + "D209", # Closing triple quotes go to new line + "D205", # 1 blank line required between summary line and description + "D213", # summary lines must be positioned on the second physical line of the docstring + "D417", # undocumented-parameter + "D419", # undocumented-returns ] ignore = [