Make pylint happier
This commit is contained in:
parent
7e0b8937e8
commit
2997b64eba
|
@ -19,5 +19,5 @@ def check_upgrade(operator: Operator) -> Iterator[CheckResult]:
|
|||
yield Fail(
|
||||
f"Channel {channel} has dangling bundles: {dangling_bundles}."
|
||||
)
|
||||
except Exception as e:
|
||||
yield Fail(str(e))
|
||||
except Exception as exc:
|
||||
yield Fail(f"{operator}: {exc}")
|
||||
|
|
|
@ -54,7 +54,7 @@ def _list(
|
|||
("Replaces", target.csv.get("spec", {}).get("replaces", "")),
|
||||
("Skips", target.csv.get("spec", {}).get("skips", [])),
|
||||
]
|
||||
max_width = max([len(key) for key, _ in info])
|
||||
max_width = max(len(key) for key, _ in info)
|
||||
for key, value in info:
|
||||
message = f"{key.ljust(max_width+1)}: {value}"
|
||||
print(indent(depth + 1) + message)
|
||||
|
|
|
@ -39,10 +39,12 @@ def _load_yaml_strict(path: Path) -> Any:
|
|||
with path.open("r") as yaml_file:
|
||||
try:
|
||||
return yaml.safe_load(yaml_file)
|
||||
except ComposerError:
|
||||
raise OperatorRepoException(f"{path} contains multiple yaml documents")
|
||||
except ParserError:
|
||||
raise OperatorRepoException(f"{path} is not a valid yaml document")
|
||||
except ComposerError as exc:
|
||||
raise OperatorRepoException(
|
||||
f"{path} contains multiple yaml documents"
|
||||
) from exc
|
||||
except ParserError as exc:
|
||||
raise OperatorRepoException(f"{path} is not a valid yaml document") from exc
|
||||
|
||||
|
||||
def load_yaml(path: Path) -> Any:
|
||||
|
|
Loading…
Reference in New Issue