Skip to content

Commit

Permalink
Use Use lazy % formatting in logging functions
Browse files Browse the repository at this point in the history
To fix pylint warnings

Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
  • Loading branch information
bact committed Nov 27, 2024
1 parent c82775d commit 575a8ad
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions ntia_conformance_checker/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,15 @@ def main():
)

# Log messages
logging.info(f"Checking SBOM: {args.file}")
logging.info(f"Compliance standard: {args.comply}")
logging.info("Checking SBOM: %s", args.file)
logging.info("Compliance standard: %s", args.comply)
logging.info(
f"SPDX validation: {'enabled' if not args.skip_validation else 'disabled'}"
"SPDX validation: %s", "enabled" if not args.skip_validation else "disabled"
)
logging.info(f"Parsing: {'OK' if not sbom.parsing_error else 'Failed'}")
if not args.skip_validation and not sbom.parsing_error:
logging.info(
f"Validation: {'OK' if not sbom.validation_messages else 'Failed'}"
)
logging.info("Parsing: %s", "OK" if not sbom.parsing_error else "Failed")
logging.info("Validation: %s", "OK" if not sbom.validation_messages else "Failed")
if not sbom.parsing_error:
logging.info(f"SBOM name: {sbom.sbom_name}")
logging.info("SBOM name: %s", sbom.sbom_name)

if args.output == "print":
sbom.print_table_output()
Expand Down

0 comments on commit 575a8ad

Please sign in to comment.