Affects PMD Version: 6.28.0
Description:
Properties documentation shown at https://pmd.github.io/pmd-6.28.0/pmd_rules_apex_codestyle.html#methodnamingconventions for MethodNamingConventions are missing from https://github.com/pmd/pmd/blob/master/pmd-apex/src/main/resources/category/apex/codestyle.xml#L247
Or am I missing something? We consume those files to generate documentation for those patterns, and other tools have properties information.
Those properties are declared in the java rule. Properties declared in Java do not need to be declared in the XML. Maybe this ticket is more about whether all properties should be discoverable from the XML, to help tools?
At Codacy we're parsing the XML files to get the properties to make them configurable in our UI. Apparently not all the properties are discoverable from the XML.
I think this is useful for external tooling and I would very much like to see this implemented. The idea already popped up when we were thinking about making a ruleset editor webapp (wiki, there is also some info here, including an item called "[doc] Generate a complete rule catalog in a machine-readable format").
I see two possible options
category/java/categories-info.json (or xml, or csv) in pmd-java-<version>.jar.IMO option 1 would be nicer, because a schema separate from the main ruleset schema would be easier to adapt to new requirements. The requirements could evolve more independently. Also this could be done before PMD 7.
OTOH option 1 probably means that this utility runs on a JVM, so it's less easy to relocate to some platforms. But this doesn't matter too much if the catalog is pre-generated I think
Most helpful comment
Those properties are declared in the java rule. Properties declared in Java do not need to be declared in the XML. Maybe this ticket is more about whether all properties should be discoverable from the XML, to help tools?