From fd7f4534c2baa11570f2d0252b11e000cb1c10ff Mon Sep 17 00:00:00 2001 From: Sina Atalay Date: Fri, 12 Jul 2024 23:18:03 +0300 Subject: [PATCH] fail the workflow if lint fails --- .github/workflows/test.yaml | 1 - pyproject.toml | 2 +- rendercv/data/generator.py | 3 ++- rendercv/data/models/curriculum_vitae.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 155ab94c..151d4355 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -31,7 +31,6 @@ jobs: - name: Lint with Ruff run: | hatch run lint - continue-on-error: true test: name: Test with Py${{ matrix.python-version }} on ${{ matrix.os }} diff --git a/pyproject.toml b/pyproject.toml index 21529eb7..6e0437d6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -144,7 +144,7 @@ path = ".venv" # Format all the code in the `rendercv` package with `black`: format = "black rendercv && black docs && black tests" # hatch run format # Lint the code in the `rendercv` package with `ruff`: -lint = "ruff check rendercv && ruff check docs && ruff check tests" # hatch run lint +lint = "ruff check rendercv" # hatch run lint # Sort the imports in the `rendercv` package with `isort`: sort-imports = "isort rendercv && isort docs && isort tests" # hatch run sort-imports # Check types in the `rendercv` package with `pyright`: diff --git a/rendercv/data/generator.py b/rendercv/data/generator.py index d565a3c6..1d62b925 100644 --- a/rendercv/data/generator.py +++ b/rendercv/data/generator.py @@ -14,7 +14,7 @@ import ruamel.yaml from . import models, reader -def dictionary_to_yaml(dictionary: dict[str, Any]): +def dictionary_to_yaml(dictionary: dict[str, Any]) -> str: """Converts a dictionary to a YAML string. Args: @@ -30,6 +30,7 @@ def dictionary_to_yaml(dictionary: dict[str, Any]): with io.StringIO() as string_stream: yaml_object.dump(dictionary, string_stream) yaml_string = string_stream.getvalue() + return yaml_string diff --git a/rendercv/data/models/curriculum_vitae.py b/rendercv/data/models/curriculum_vitae.py index 964f7cc6..6776bf5f 100644 --- a/rendercv/data/models/curriculum_vitae.py +++ b/rendercv/data/models/curriculum_vitae.py @@ -62,7 +62,7 @@ def create_a_section_validator(entry_type: Type) -> Type[SectionBase]: Returns: Type[SectionBase]: The section validator (a Pydantic model). """ - if entry_type == str: + if entry_type is str: model_name = "SectionWithTextEntries" entry_type_name = "TextEntry" else: