Skip to content

Add report-converter --example flag and EXAMPLE_CMD interface (#4992) - #4996

Open
mmido6039 wants to merge 2 commits into
Ericsson:masterfrom
mmido6039:fix-4992-report-converter-example-cmd
Open

Add report-converter --example flag and EXAMPLE_CMD interface (#4992)#4996
mmido6039 wants to merge 2 commits into
Ericsson:masterfrom
mmido6039:fix-4992-report-converter-example-cmd

Conversation

@mmido6039

Copy link
Copy Markdown
Contributor

Summary

Fixes #4992 by adding a standardized way for report-converter analyzers to expose example commands for generating compatible input.

What changed

  • Added the EXAMPLE_CMD interface field to AnalyzerResultBase.

  • Added EXAMPLE_CMD to the Ruff analyzer parser.

  • Added a new --example <ANALYZER> CLI option to report-converter.

  • --example works independently of the other required CLI arguments, similarly to --help and --version.

  • Added documentation for Ruff and the new --example functionality.

  • Added a documentation note recommending --example as the up-to-date source for analyzer example commands.

  • Added CLI/interface tests covering:

    • An analyzer with an EXAMPLE_CMD.
    • An analyzer without an EXAMPLE_CMD.
    • Invalid analyzer names.
    • Enforcement that newly added analyzer parsers define EXAMPLE_CMD.

Validation

Manually verified:

  • report-converter --example ruff prints the expected example command and exits successfully.
  • report-converter --example pylint handles an analyzer without an example gracefully without crashing.
  • Invalid analyzer names are rejected cleanly by argparse.

All 5 newly added tests pass.

The broader report-converter test suite also contains pre-existing/environment-related failures unrelated to this change, including fixture corruption and package metadata mismatches. These were verified against the unmodified codebase.

Motivation

This provides a consistent interface for analyzer-specific example commands and prevents new analyzer parsers from being added without documenting how their compatible input can be generated.

@mmido6039
mmido6039 requested review from bruntib and dkrupp as code owners July 30, 2026 21:03
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.

report-converter prints help about the input's format

1 participant