Skip to content

Commit

Permalink
Fix pycodestyle checks
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Oct 8, 2024
1 parent 85ac59e commit 12d9e3c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .prospector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,9 @@ pylint:
bandit:
options:
config: .bandit.yaml

pycodestyle:
disable:
# Buggy checks that don't detect strings
- W604 # backticks are deprecated, use 'repr()'
- E221 # multiple spaces before operator
7 changes: 4 additions & 3 deletions c2cciutils/lib/oidc.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,15 @@ def _get_token(hostname: str) -> str:
a few minutes and try again.
You can monitor PyPI's status here: https://status.python.org/
"""
""" # noqa: E702
)

# On failure, the JSON response includes the list of errors that
# occurred during minting.
if not mint_token_resp.ok:
reasons = "\n".join(
f'* `{error["code"]}`: {error["description"]}' for error in mint_token_payload["errors"]
f'* `{error["code"]}`: {error["description"]}'
for error in mint_token_payload["errors"] # noqa: W604
)

rendered_claims = _render_claims(oidc_token)
Expand Down Expand Up @@ -159,7 +160,7 @@ def pypi_login() -> None:
pypirc_filename = os.path.expanduser("~/.pypirc")

if os.path.exists(pypirc_filename):
print(f"::info::{pypirc_filename} already exists; consider as already logged in.")
print(f"::info::{pypirc_filename} already exists; consider as already logged in.") # noqa: E702
return

if "ACTIONS_ID_TOKEN_REQUEST_TOKEN" not in os.environ:
Expand Down
4 changes: 2 additions & 2 deletions c2cciutils/scripts/k8s/wait.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def _check_container_status(pod: Any, status: Any, is_init: bool = False) -> boo
status_message = status_message.strip()
if status_message == "Completed":
return True
print(f'::group::Container not ready in {pod["metadata"]["name"]}: {status_message}')
print(f'::group::Container not ready in {pod["metadata"]["name"]}: {status_message}') # noqa: E713
if status_message_long != status_message:
print(status_message_long)
print(json.dumps(status, indent=4))
Expand All @@ -68,7 +68,7 @@ def _check_pod_status(pods: Any) -> bool:
for condition in pod["status"].get("conditions", []):
if not condition["status"]:
print(
f'::group::Pod not ready in {pod["metadata"]["name"]}: {condition.get("message", condition["type"])}'
f'::group::Pod not ready in {pod["metadata"]["name"]}: {condition.get("message", condition["type"])}' # noqa: E713
)
print(json.dumps(condition, indent=4))
print("::endgroup::")
Expand Down

0 comments on commit 12d9e3c

Please sign in to comment.