Open yamioliva opened 1 month ago
hi @yamioliva :)
I think it's related to the newest version of MegaLinter, that contains sfdx-scanner v4, that contains PMD7 (previous was PMD6)
Some PMD6 rules has been removed, so you can just remove the crashing part (the custom Xpath rule) in your PMD ruleset XML file, and it should be ok :)
Best regards
@yamioliva I think I solved the issue on the online default PMD rulesets file :)
Please can yo ucheck again ? :)
Hi Nico,
Thanks for the quick response!
Ok! I’ll keep you posted on the outcome.
Best regards, Yamilet
El vie, 12 jul 2024, 14:50, Nicolas Vuillamy @.***> escribió:
@yamioliva https://github.com/yamioliva I think I solved the issue on the online default PMD rulesets file :)
Please can yo ucheck again ? :)
— Reply to this email directly, view it on GitHub https://github.com/hardisgroupcom/sfdx-hardis/issues/643#issuecomment-2225511184, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJDGDT5DW3NL25FBIJ36IYTZL7GI3AVCNFSM6AAAAABKXNJ25KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRVGUYTCMJYGQ . You are receiving this because you were mentioned.Message ID: @.***>
Hi Nico,
Petite question. I understand that removing the custom XPath rule might fix the immediate problem, but this rule helps us a lot. It ensures we don't hardcode callout endpoint URLs in our Apex code, and instead, use Named Credentials. This is important for keeping our code secure and flexible.
I want to make sure we keep this functionality. Does MegaLinter have a similar rule or check that enforces this practice? If not, is there a way to update or adapt this rule to work with PMD7 in MegaLinter?
Your help would be really appreciated.
Thanks! Yamilet
@yamioliva I don't know if it is a default PMD7 rule, I'll have a look :)
ps: maybe @maximeg44 know ^^
@yamioliva I don't know if it is a default PMD7 rule, I'll have a look :)
ps: maybe @maximeg44 know ^^
Ok, thanks!
Hi Nico,
The error persists even after removing the custom rule. Here is the current error message:
Error (1): No files were found in the target. --target must contain at least one file.
Attached is a screenshot of the current error.
Any further guidance would be appreciated.
Thank you!
@yamioliva hmmm sfdx-scanner is not great for Aura / LWC ...
I'm in vacations, before we make a call when I come back, I suggest you disable this linter by adding the following line in your .mega-linter.yml :)
SALESFORCE_SFDX_SCANNER_LWC_DISABLE_ERRORS=true
@nvuillam no problem, as I mentioned in my initial description, I have already done that to avoid errors during deployments. However, this prevents the technical definition from being displayed. I just wanted to solve the error, but of course, it can wait ;) Thank you! Have a great holiday!
Hey team, we've run into an issue with the PMD ruleset configuration while using the
sfdx-hardis
plugin.So, here's what's happening:
sfdx-hardis
plugin.Expected Behavior:
The PMD ruleset should run without errors, and the technical definitions should be visible in the pipeline.
Actual Behavior:
Screenshots:
Initial Error in PMD Ruleset Configuration:![Initial Error in PMD Ruleset Configuration](https://github.com/hardisgroupcom/sfdx-hardis/assets/38166991/0975401e-8f0b-4eec-8ef4-27c20e0792d2)
Configuration Workaround:![Configuration Workaround](https://github.com/hardisgroupcom/sfdx-hardis/assets/38166991/a8accbd6-0210-477a-995e-1ce7f0cb0521)
Missing Technical Definitions in Pipeline:![Missing Technical Definitions in Pipeline2](https://github.com/hardisgroupcom/sfdx-hardis/assets/38166991/01bf2124-7d5f-43de-b289-ac6ec6c9f30b)
PMD Ruleset XML Configuration:![PMD Ruleset XML Configuration](https://github.com/hardisgroupcom/sfdx-hardis/assets/38166991/bb650e6b-f302-4572-abc2-bd5346f62915)
Environment:
Additional Context:
We applied the workaround by skipping the error in the YAML file, which fixed the initial problem but caused us to lose the technical definition visibility in the pipeline.
We're looking for help to solve the PMD ruleset configuration error without losing the technical definitions in the pipeline. Has anyone else faced this? Any known fixes?
Thanks for your support!