tox: enfore 100% coverage and add pylint
This commit is contained in:
parent
f46348d7a0
commit
42843b4885
|
@ -43,7 +43,7 @@ def check_image(bundle: Bundle) -> Iterator[CheckResult]:
|
||||||
if any(container_image == x.get("image") for x in containers):
|
if any(container_image == x.get("image") for x in containers):
|
||||||
return
|
return
|
||||||
yield Fail(f"container image {container_image} not used by any deployment")
|
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))
|
yield Fail(str(exc))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -21,5 +21,5 @@ def check_upgrade(operator: Operator) -> Iterator[CheckResult]:
|
||||||
yield Fail(
|
yield Fail(
|
||||||
f"Channel {channel} has dangling bundles: {dangling_bundles}"
|
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))
|
yield Fail(str(exc))
|
||||||
|
|
|
@ -40,12 +40,12 @@ def show_operator(operator: Operator, recursive: bool = False, depth: int = 0) -
|
||||||
print(indent(depth) + str(operator))
|
print(indent(depth) + str(operator))
|
||||||
for bundle in operator:
|
for bundle in operator:
|
||||||
if recursive:
|
if recursive:
|
||||||
show_bundle(bundle, recursive, depth + 1)
|
show_bundle(bundle, depth + 1)
|
||||||
else:
|
else:
|
||||||
print(indent(depth + 1) + str(bundle))
|
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))
|
print(indent(depth) + str(bundle))
|
||||||
csv_annotations = bundle.csv.get("metadata", {}).get("annotations", {})
|
csv_annotations = bundle.csv.get("metadata", {}).get("annotations", {})
|
||||||
info = [
|
info = [
|
||||||
|
@ -69,7 +69,7 @@ def show(target: Union[Repo, Operator, Bundle], recursive: bool = False) -> None
|
||||||
elif isinstance(target, Operator):
|
elif isinstance(target, Operator):
|
||||||
show_operator(target, recursive, 1 * recursive)
|
show_operator(target, recursive, 1 * recursive)
|
||||||
elif isinstance(target, Bundle):
|
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:
|
def action_list(repo: Repo, *what: str, recursive: bool = False) -> None:
|
||||||
|
|
3
tox.ini
3
tox.ini
|
@ -6,5 +6,6 @@ isolated_build = True ; This is required for a pyproject.toml based project.
|
||||||
groups = ; Dependency groups in pyproject.toml
|
groups = ; Dependency groups in pyproject.toml
|
||||||
dev
|
dev
|
||||||
commands =
|
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
|
mypy --strict src tests
|
||||||
|
|
Loading…
Reference in New Issue