Skip to content

fix : move unreachable docstring in RegistryValidator.report and fix --strict flag - #1862

Open
tmdeveloper007 wants to merge 1 commit into
steam-bell-92:mainfrom
tmdeveloper007:pr-1857
Open

fix : move unreachable docstring in RegistryValidator.report and fix --strict flag#1862
tmdeveloper007 wants to merge 1 commit into
steam-bell-92:mainfrom
tmdeveloper007:pr-1857

Conversation

@tmdeveloper007

Copy link
Copy Markdown
Contributor

Summary of What Has Been Done

In utils/registry_validator.py, the report() method had two bugs:

  1. The docstring """Print validation summary.""" was placed AFTER the if json_output: return statement, making it an unreachable string literal instead of a proper method docstring.
  2. The --strict flag only checked validator.errors to set the exit code. The intended behavior of treating warnings as errors in strict mode was dead code because the sys.exit(1 if args.strict and validator.warnings) line was unreachable.

Changes Made

  1. Moved the docstring to the beginning of the report method.
  2. Fixed the exit code logic to properly treat warnings as errors in strict mode: sys.exit(1 if validator.errors else (1 if args.strict and validator.warnings else 0)).

Impact it Made

  • Developers can now read the docstring via help() or IDE tooltips.
  • --strict mode now correctly returns exit code 1 when warnings are present, enabling proper CI/CD integration.

Closes #1857.

Note: Please assign this PR to the tmdeveloper007 account.

@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the Anuj's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix : move unreachable docstring in RegistryValidator.report and fix --strict flag to treat warnings as errors

1 participant