Skip to content

NEW @W-22465143@ Add ast-dump command for generating PMD AST output#2050

Open
nikhil-mittal-165 wants to merge 1 commit into
devfrom
feature/ast-dump
Open

NEW @W-22465143@ Add ast-dump command for generating PMD AST output#2050
nikhil-mittal-165 wants to merge 1 commit into
devfrom
feature/ast-dump

Conversation

@nikhil-mittal-165

Copy link
Copy Markdown
Contributor

PMD Custom Rules: AST Dump Support

Creating PMD custom rules requires AST dumps of the relevant source patterns and classes. Currently, the CLI has no way to retrieve AST output from core and surface it to users.

This change introduces a new --ast-dump flag (exposed as the code-analyzer ast-dump command) that generates and returns the Abstract Syntax Tree produced by PMD for a given source file, in XML format. The output can then be used by the creating-custom-rule skill to generate precise XPath expressions for authoring PMD custom rules.

Supports Apex, Visualforce, HTML, XML, and JavaScript, with both JSON and XML output formats.

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.

1 participant