Skip to content

Commit

Permalink
Fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkaMaul committed Jun 21, 2024
1 parent 007f424 commit 5a66a7c
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/pypi_attestation_models/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
from pypi_attestation_models import __version__
from pypi_attestation_models._impl import Attestation, VerificationError

logging.basicConfig(
format="%(message)s", datefmt="[%X]", handlers=[logging.StreamHandler()]
)
logging.basicConfig(format="%(message)s", datefmt="[%X]", handlers=[logging.StreamHandler()])
_logger = logging.getLogger(__name__)
_logger.setLevel(logging.INFO)

Expand Down Expand Up @@ -191,9 +189,7 @@ def _sign(args: argparse.Namespace) -> None:
_die(args, f"Signature already exists for {file_path}")

attestation = Attestation.sign(signer, file_path)
_logger.debug(
"Attestation saved for %s saved in %s", file_path, signature_path
)
_logger.debug("Attestation saved for %s saved in %s", file_path, signature_path)

signature_path.write_text(attestation.model_dump_json())

Expand Down Expand Up @@ -226,9 +222,7 @@ def _inspect(args: argparse.Namespace) -> None:
_logger.info(f"\tType: {decoded_statement['_type']}")
_logger.info("\tSubject:")
for subject in decoded_statement["subject"]:
_logger.info(
f"\t\t{subject['name']} (digest: {subject['digest']['sha256']})"
)
_logger.info(f"\t\t{subject['name']} (digest: {subject['digest']['sha256']})")

_logger.info(f"\tPredicate type: {decoded_statement['predicateType']}")
_logger.info(f"\tPredicate: {decoded_statement['predicate']}")
Expand Down Expand Up @@ -279,9 +273,7 @@ def _verify(args: argparse.Namespace) -> None:
try:
attestation.verify(verifier, pol, file_path)
except VerificationError as verification_error:
_logger.error(
"Verification failed for %s: %s", file_path, verification_error
)
_logger.error("Verification failed for %s: %s", file_path, verification_error)
continue

_logger.info(f"OK: {attestation_path}")
Expand Down

0 comments on commit 5a66a7c

Please sign in to comment.