1 /* 2 com.puppycrawl.tools.checkstyle.meta.JavadocMetadataScraper 3 writeXmlOutput = false 4 5 6 */ 7 8 package com.puppycrawl.tools.checkstyle.meta.javadocmetadatascraper; 9 10 import java.util.Arrays; 11 import java.util.Collections; 12 import java.util.HashSet; 13 import java.util.Set; 14 import java.util.regex.Pattern; 15 16 import com.puppycrawl.tools.checkstyle.StatelessCheck; 17 18 19 20 21 22 /** 23 * <p> 24 * Checks that 25 * <a href="https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html#firstsentence"> 26 * Javadoc summary sentence</a> does not contain phrases that are not recommended to use. 27 * Summaries that contain only the {@code {@inheritDoc}} tag are skipped. 28 * Check also violate Javadoc that does not contain first sentence. 29 * </p> 30 * <ul> 31 * <li> 32 * Property {@code violateExecutionOnNonTightHtml} - Control when to print violations 33 * if the Javadoc being examined by this check violates the tight html rules defined at 34 * <a href="https://checkstyle.org/writingjavadocchecks.html#Tight-HTML_rules">Tight-HTML Rules</a>. 35 * Type is {@code boolean}. 36 * Default value is {@code false}. 37 * </li> 38 * <li> 39 * Property {@code forbiddenSummaryFragments} - Specify the regexp for forbidden summary fragments. 40 * Type is {@code java.util.regex.Pattern}. 41 * Default value is {@code "^$"}. 42 * </li> 43 * <li> 44 * Property {@code period} - Specify the period symbol at the end of first javadoc sentence. 45 * Type is {@code java.lang.String}. 46 * Default value is {@code "."}. 47 * </li> 48 * </ul> 49 * <p> 50 * To configure the default check to validate that first sentence is not empty and first 51 * sentence is not missing: 52 * </p> 53 * <pre> 54 * skipped as not relevant for UTs 55 * </pre> 56 * <p> 57 * Parent is {@code com.puppycrawl.tools.checkstyle.TreeWalker} 58 * </p> 59 * <p> 60 * Violation Message Keys: 61 * </p> 62 * <ul> 63 * <li> 64 * {@code javadoc.missed.html.close} 65 * </li> 66 * <li> 67 * {@code javadoc.parse.rule.error} 68 * </li> 69 * <li> 70 * {@code javadoc.wrong.singleton.html.tag} 71 * </li> 72 * <li> 73 * {@code summary.first.sentence} 74 * </li> 75 * <li> 76 * {@code summary.javaDoc} 77 * </li> 78 * <li> 79 * {@code summary.javaDoc.missing} 80 * </li> 81 * </ul> 82 * 83 * @since 6.0 84 */ 85 @StatelessCheck 86 public abstract class InputJavadocMetadataScraperSummaryJavadocCheck { 87 88 }