1
0
Fork 0

tox: enfore 100% coverage and add pylint

This commit is contained in:
Maurizio Porrato 2023-08-18 17:33:07 +01:00
parent f46348d7a0
commit 42843b4885
4 changed files with 7 additions and 6 deletions

View File

@ -43,7 +43,7 @@ def check_image(bundle: Bundle) -> Iterator[CheckResult]:
if any(container_image == x.get("image") for x in containers):
return
yield Fail(f"container image {container_image} not used by any deployment")
except Exception as exc:
except Exception as exc: # pylint: disable=broad-exception-caught
yield Fail(str(exc))

View File

@ -21,5 +21,5 @@ def check_upgrade(operator: Operator) -> Iterator[CheckResult]:
yield Fail(
f"Channel {channel} has dangling bundles: {dangling_bundles}"
)
except Exception as exc:
except Exception as exc: # pylint: disable=broad-exception-caught
yield Fail(str(exc))

View File

@ -40,12 +40,12 @@ def show_operator(operator: Operator, recursive: bool = False, depth: int = 0) -
print(indent(depth) + str(operator))
for bundle in operator:
if recursive:
show_bundle(bundle, recursive, depth + 1)
show_bundle(bundle, depth + 1)
else:
print(indent(depth + 1) + str(bundle))
def show_bundle(bundle: Bundle, recursive: bool = False, depth: int = 0) -> None:
def show_bundle(bundle: Bundle, depth: int = 0) -> None:
print(indent(depth) + str(bundle))
csv_annotations = bundle.csv.get("metadata", {}).get("annotations", {})
info = [
@ -69,7 +69,7 @@ def show(target: Union[Repo, Operator, Bundle], recursive: bool = False) -> None
elif isinstance(target, Operator):
show_operator(target, recursive, 1 * recursive)
elif isinstance(target, Bundle):
show_bundle(target, recursive, 2 * recursive)
show_bundle(target, 2 * recursive)
def action_list(repo: Repo, *what: str, recursive: bool = False) -> None:

View File

@ -6,5 +6,6 @@ isolated_build = True ; This is required for a pyproject.toml based project.
groups = ; Dependency groups in pyproject.toml
dev
commands =
pytest --cov-report term-missing --cov=operator_repo -v tests/
pytest --cov-report term-missing --cov-fail-under=100 --cov=operator_repo -v tests/
pylint --disable=R,C src
mypy --strict src tests