Skip to content

Commit 7c8748d

Browse files
authored
Filter non-attestation files in the inspect subcommand (#93)
1 parent 668ac9e commit 7c8748d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/pypi_attestations/_cli.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,9 @@ def _inspect(args: argparse.Namespace) -> None:
390390
391391
Warning: The information displayed from the attestations are not verified.
392392
"""
393-
_validate_files(args.files, should_exist=True)
394-
for file_path in args.files:
393+
attestation_files = [f for f in args.files if f.suffix == '.attestation']
394+
_validate_files(attestation_files, should_exist=True)
395+
for file_path in attestation_files:
395396
try:
396397
attestation = Attestation.model_validate_json(file_path.read_bytes())
397398
except ValidationError as validation_error:

0 commit comments

Comments
 (0)