maxvetrenko / checkstyle

Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard. By default it supports the Sun Code Conventions, but is highly configurable. It can be invoked with an ANT task and a command line program.
http://checkstyle.sourceforge.net/
GNU Lesser General Public License v2.1
0 stars 0 forks source link

New Check: JavaDocParagraph #3

Closed maxvetrenko closed 10 years ago

maxvetrenko commented 10 years ago

Need to cover next rule: http://google-styleguide.googlecode.com/svn/trunk/javaguide.html#s7.1.2-javadoc-paragraphs

One blank line—that is, a line containing only the aligned leading asterisk (*)—appears between paragraphs, and before the group of "at-clauses" if present. Each paragraph but the first has <p> immediately before the first word, with no space after.

Tag <p> should be immediately followed by any word. If tag <p> is present, blank line should be plased before. If blank line is present, next line should be started with <p> tag. For exampe:

/**
 * Custom GWT serializer for {@link Absent}.
 *
 * <p>GWT can serialize an absent {@code Optional} on its own, but the resulting
 * object is a different instance than the singleton {@code Absent.INSTANCE},
 * which breaks equality. We implement a custom serializer to maintain the
 * singleton property.
 * 
 */
maxvetrenko commented 10 years ago
  1. Выполнить поиск html тега

    или пустой строки.

  2. Если найден html тег

    , то проверить правильность его положения: а. Если тег стоит в начале первого параграфа - ОШИБКА . Иначе: а.1 Если тег стоит в средине или конце предложения - ОШИБКА. Иначе: а.2 Если перед тегом нет пустой строки - ОШИБКА. Иначе: а.3 Если после тега есть пробел - ОШИБКА.

  3. Если найдена пустая строка, то проверить правильность ее положения: а. Если после пустрой строки нет предложения которое начинается на html тег

    - ОШИБКА.

romani commented 10 years ago

Please provide checkstyle configuration that you expect to implement.

maxvetrenko commented 10 years ago

@romani

<module name="JavaDocParagraph"/>