Skip to content

Commit

Permalink
fix: project version now return the real truthy version
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniele-Tentoni committed Feb 23, 2022
1 parent 6eed196 commit 8000464
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cc_codechecker/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def dotnet_run(**kwargs) -> tuple[int, str]: # pragma: no cover

class Project(Configurable):
"""Define a Project."""

language: str
runner: Runner

Expand All @@ -80,7 +81,7 @@ def __init__(
language: str,
**kwargs
) -> None:
"""Creates a new Project instance.
"""Create a new Project instance.
Creates a new Project instance checking that language given is in known
languages array.
Expand Down Expand Up @@ -115,6 +116,7 @@ def __init__(
print(f'Adding Project {self.language}')

def __repr__(self) -> str:
"""Represent the project with a string."""
return f'{self.__class__.__name__}(language={self.language})'

def dump(self) -> dict[str, Any]:
Expand All @@ -129,7 +131,6 @@ def dump(self) -> dict[str, Any]:
Returns:
dict[str, Any]: dictionary dumped.
"""

items = self.__dict__.items()
valued = {k:v for k, v in items if self._excluded(k, v)}
return valued
Expand All @@ -146,7 +147,7 @@ def version(self) -> bool:
Returns:
bool: True if tools are installed, false otherwise.
"""
return self.runner.version() is True
return bool(self.runner.version())

def run(self, contents) -> tuple[int, str]:
"""Execute the project with kwargs arguments.
Expand Down

0 comments on commit 8000464

Please sign in to comment.