Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SingleLineJavadoc update for new requirements what tags are allowed in singleline javadoc #4052

Closed
romani opened this issue Mar 19, 2017 · 4 comments · Fixed by #9270
Closed

Comments

@romani
Copy link
Member

romani commented Mar 19, 2017

parent issue - #3888

guide update - google/styleguide@594d91b#diff-b6c9191ee5ccb7a5ef170e98e51d94d8L1084

The basic form is always acceptable. The single-line form may be substituted when the entirety
of the Javadoc block (including comment markers) can fit on a single line. Note that this only
applies when there are no block tags such as @return.

http://checkstyle.sourceforge.net/config_javadoc.html#SingleLineJavadoc

we already have property - ignoredTags and it is null by default so no block tags are allowed.
ignoreInlineTags - is true by default.

We need to change our google config to ignore inline tags (switch to default by removing ignoreInlineTags).
current code:

<module name="SingleLineJavadoc">
<property name="ignoreInlineTags" value="false"/>
</module>

definition of "block tags" (exact list of them) - http://docs.oracle.com/javase/8/docs/technotes/tools/windows/javadoc.html#CHDBEFIF (for java7)
Lets save this link in xdoc to explain user meaning of such terms.

lets do updates for our IT inputs, case from #3762 should be added too.


Current behavior:

/var/tmp$ cat Test.java 
public class Test {
  /** Create a new {@code Test} instance. */
  public Test() {}
}

/var/tmp$ java -jar checkstyle-8.36.2-all.jar -c /google_checks.xml Test.java
Starting audit...
[WARN] /var/tmp/Test.java:2: Single-line Javadoc comment should be multi-line. [SingleLineJavadoc]
Audit done.

Expected: no violations.

@romani romani changed the title SingleLineJavadoc allow to define at-clauses that are not allowed to be in single line javadoc SingleLineJavadoc update for new requirements what tags are allowed in singlline javadoc Mar 19, 2017
@romani romani changed the title SingleLineJavadoc update for new requirements what tags are allowed in singlline javadoc SingleLineJavadoc update for new requirements what tags are allowed in singleline javadoc Mar 19, 2017
@alexbde
Copy link

alexbde commented Jan 23, 2018

Hey guys, we have false positives with google-java-format and default google_checks.xml config.

We need to change our google config to ignore inline tags (switch to default).

So that means current solution/workaround is to remove <property name="ignoreInlineTags" value="false"/> from <module name="SingleLineJavadoc">. Right?

Have you got any plans to update google_checks.xml in master?

Thank you in advance!

@checkstyle checkstyle deleted a comment from divsidhu-26 Jan 23, 2018
@romani
Copy link
Member Author

romani commented Jan 23, 2018

Have you got any plans to update google_checks.xml in master?

Issue is approved, we just wait for smb to fix it. Please send PR , we will guide you on all required changes.

So that means current solution/workaround is to remove from . Right?

Yes. It will work to make a workaround on your side.
To fix it in master, in addition to config change, there should be done trivial changes in tests files, as some violations should disappear

@himanshurijal
Copy link

I am on it.

@romani
Copy link
Member Author

romani commented Mar 3, 2021

fix is merged

@romani romani added the bug label Mar 3, 2021
SGanguly1999 pushed a commit to SGanguly1999/checkstyle that referenced this issue Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants