Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow input for registering custom rules #14

Closed
mitchspano opened this issue Aug 8, 2022 · 2 comments
Closed

Allow input for registering custom rules #14

mitchspano opened this issue Aug 8, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@mitchspano
Copy link
Owner

When using a PMD ruleset file which contains a custom rule, sfdx scanner requires the registration of the rules before they can be picked up by the scan. For each file, we need to call sfdx scanner:rule:add with the appropriate --language and --path arguments.

The sfdx-scan-pull-request action should enable users to define the languages and paths that they want to register before scan execution.

For additional context, see this comment.

@mitchspano
Copy link
Owner Author

I've began working on this in the feature/registerCustomRules branch.

We can test it out like this:

- name: Run SFDX Scanner - Report findings as comments
  uses: mitchspano/sfdx-scan-pull-request@feature/registerCustomRules
  with:
    report-mode: comments
    pmdconfig: "pmd/category/xml/custom.xml"
    custom-pmd-rules: '[{ "rulesetPath": "pmd/category/xml/custom.xml", "language": "xml"}]'
  env:
    GITHUB_TOKEN: ${{ secrets.TOKEN }}

@mitchspano
Copy link
Owner Author

I was able to register custom Apex rules and have them executed with the scan:

image

I will make some additional minor changes over the weekend, but looking forward to publishing this improvement to the action!

mitchspano added a commit that referenced this issue May 28, 2023
Support registration of custom rules (enables #14)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant