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 disablement via VSCode settings #166

Open
NickTracker opened this issue May 23, 2024 · 4 comments
Open

Allow disablement via VSCode settings #166

NickTracker opened this issue May 23, 2024 · 4 comments

Comments

@NickTracker
Copy link

NickTracker commented May 23, 2024

Is your feature request related to a problem? Please describe.
When I go to a different repo that is missing a standards xml I get a bunch of errors in my IDE saying that Apex PMD can't find the standards.xml path which is provided in the "apexPMD.rulesets" property of settings.

Describe the solution you'd like
I'd like a way to disable the extension via the command pallette.

GIVEN I'm a VSCode user
WHEN I type cmd+shift+p
  AND I type "disable pmd"
THEN I see an action to disable PMD
  AND I see an action to enable PMD
  AND selecting either option disables/enables respectively

Additional context
Screenshot 2024-05-23 at 18 00 01

@adangel
Copy link
Collaborator

adangel commented May 24, 2024

This might be a duplicate of #163

@NickTracker
Copy link
Author

NickTracker commented May 24, 2024

Both of these projects are sfdx projects, one of them doesn't have the xml standards in them. The other feature request is asking that PMD skips running in non-sfdx projects.

@AndrewStopchenko-SO
Copy link

AndrewStopchenko-SO commented Jan 11, 2025

Hi @NickTracker,

From looking at your initial problem description, it sounds like you have some customized PMD rule set standards.xml file stored in some particular Project1 project's folder:

  • Project1/pmdRulesets/standards.xml file

And you have conigured your ApexPMD to use that file in your User settings:

  • "ApexPMD.rulesets": "./pmdRulesets/standards.xml".

If this is a project-specific ruleset file, you can set this configuration on your Workspace settings rather than User settings - then it only applies when you run ApexPMD from your Project1 workspace/folder.

image

These workspace-specific configs are written into the Project1/.vscode/settings.json file, e.g.:

{
    "apexPMD.rulesets": [
        "./.pmd-temp/quickstart_securityOnly.xml"
    ]
}

@NickTracker
Copy link
Author

Interesting, thank you! I will try today and report back.

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

No branches or pull requests

3 participants