From be4d92e375617ab270d2bc1bf07b24cdcccb8c02 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Thu, 11 Jan 2024 15:43:37 +0000 Subject: [PATCH] Minor type check --- .github/workflows/test.yml | 4 +++- src/llm_utils/llm_utils.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dbc16d0..e6992ae 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,4 +30,6 @@ jobs: run: python3 -m pytest - name: Run mypy - run: mypy . + run: | + python3 -m mypy --strict src + python3 -m mypy test diff --git a/src/llm_utils/llm_utils.py b/src/llm_utils/llm_utils.py index 95de03f..cc79ec9 100644 --- a/src/llm_utils/llm_utils.py +++ b/src/llm_utils/llm_utils.py @@ -140,7 +140,7 @@ def read_lines(file_path: str, start_line: int, end_line: int) -> tuple[list[str # Prevent pathological case where lines are REALLY long. max_chars_per_line = 128 - def truncate(s, l): + def truncate(s: str, l: int) -> str: """ Truncate the string to at most the given length, adding ellipses if truncated. """