Add report-converter --example flag and EXAMPLE_CMD interface (#4992) - #4996
Open
mmido6039 wants to merge 2 commits into
Open
Add report-converter --example flag and EXAMPLE_CMD interface (#4992)#4996mmido6039 wants to merge 2 commits into
mmido6039 wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #4992 by adding a standardized way for
report-converteranalyzers to expose example commands for generating compatible input.What changed
Added the
EXAMPLE_CMDinterface field toAnalyzerResultBase.Added
EXAMPLE_CMDto the Ruff analyzer parser.Added a new
--example <ANALYZER>CLI option toreport-converter.--exampleworks independently of the other required CLI arguments, similarly to--helpand--version.Added documentation for Ruff and the new
--examplefunctionality.Added a documentation note recommending
--exampleas the up-to-date source for analyzer example commands.Added CLI/interface tests covering:
EXAMPLE_CMD.EXAMPLE_CMD.EXAMPLE_CMD.Validation
Manually verified:
report-converter --example ruffprints the expected example command and exits successfully.report-converter --example pylinthandles an analyzer without an example gracefully without crashing.All 5 newly added tests pass.
The broader
report-convertertest 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.