Apex Naming Convention Rule #4999
Unanswered
justinstroudbah
asked this question in
Q&A
Replies: 1 comment 1 reply
-
I'm unsure I follow… When you run PMD through Salesforce Code Analyzer, you can provide a custom ruleset through Having said that, if you feel PMD naming rules are limited / insufficient, feel free to submit a PR to improve them. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Salutations,
Since I've let on that I like working with PMD, I've been pretty busy. So far, in the last few months I've written a gang of rules that apply to all sorts of quirky situations. I am having a heck of a time with something that seems simple but has turned into a real head-scratcher.
Here is the short story:
I am attempting to write a rule that handled custom naming conventions (as defined by a configurable RegEx pattern.) The language I am inspecting, Apex, already has something in place that does not work properly when I need to validate inner classes. It sees them as any old class with the attendant naming scheme.
I've built the rule, and because I don't want to go nuclear and fork the Aoex language module yet I commented out the out-of-the-box definition for that Apex module rule. I then created a new rule within our namespace that does basically the same thing with a couple of tweaks that allow for more flexible alternate naming conventions. This class can be referenced by multiple rule definitions, and has properties that allow for creating several other "definitions".
THIS IS THE ISSUE:
When I run locally, it works fine and picks up all of the violations for our entire codebase. When I attempt to run it via a GitHub action, it just hangs while scanning. I did notice that the "old" Apex rule is still being seen by the Salesforce CLI. I basically need to disable the built-in class naming convention rule so mine is the preferred standard. * It looks like it's still trying to apply the old naming convention rule.
My Project:
I hope I didn't lose you all there, but the TL;DR is that I need to completely disable a canned Apex rule. I already commented out the existing rule to no avail.
Thank you!
Justin Stroud
Beta Was this translation helpful? Give feedback.
All reactions