Skip to content

Add new Notes Macro #17310

@SteLeo1602

Description

@SteLeo1602

Currently, we have to manually insert modules' notes subsection in the xdoc files which is very inconvenient as we have to do so every time it changes.

Examples:
Notes subsection is plainly placed in the template file as text -

<subsection name="Notes" id="Notes">
<p>
There are two options to make validation more precise: <b>exceptionVariableName</b> and
<b>commentFormat</b>.
If both options are specified - they are applied by <b>any of them is matching</b>.
</p>
</subsection>

We can create the notes macro that would just require us to paste the following once in the template file:

  <macro name="notes">
      <param name="modulePath"
            value="src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/EmptyCatchBlockCheck.java"/>
  </macro>

for it to automatically extract current notes part from the javadoc of module.


We will also need to add "Notes:" javadoc marking to javadoc of each needed module to make it possible to distinguish which part of javadoc is Notes

Example:

*
* <p>
* There are two options to make validation more precise: <b>exceptionVariableName</b> and
* <b>commentFormat</b>.
* If both options are specified - they are applied by <b>any of them is matching</b>.
* </p>

In order to make it visible that this part belongs to Notes subsection, we could just transform it to:

 * <p>
 * Notes:
 * There are two options to make validation more precise: <b>exceptionVariableName</b> and
 * <b>commentFormat</b>.
 * If both options are specified - they are applied by <b>any of them is matching</b>.
 * </p>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions