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
Issue #7183: add JavadocMissingWhitespaceAfterAsteriskCheck #7775
Issue #7183: add JavadocMissingWhitespaceAfterAsteriskCheck #7775
Conversation
Please look over report and configure it for the check you are making. |
4d9e0d7
to
a59ead9
Compare
I have updated the report. The CI is failing as there are other files in CheckStyle that violate this check. Can tell me how to work around this? Thx very much. |
If the violations are correct, you must fix the issues in Checkstyle's code base. |
Please squash all commits in one and resolve All CIs, all CIs should be green. |
Hi before I correct all the missing whitespace in CheckStyle code I would like to check, should this check apply to single line comment?
|
@0blivious Why wouldn't the check apply to all javadocs and all asterisks in the javadoc? What would you want it to do? |
Yes, this should be violation. |
58 *<pre>
59 *ResolverUtil<ActionBean> resolver = new ResolverUtil<ActionBean>();
60 *resolver.findImplementation(ActionBean.class, pkg1, pkg2);
61 *resolver.find(new CustomTest(), pkg1);
62 *resolver.find(new CustomTest(), pkg2);
63 *Collection<ActionBean> beans = resolver.getClasses();
64 *</pre> The violation occurs only on the first line. @0blivious, please find out what is the output of the Javadoc tool for this class? And DetailAst generated with |
0543546
to
44781a8
Compare
I have changed the check implementation and updated the regression report. It now will report violation for all these lines. I got some new problem regarding the implementation with comment like those in https://0blivious.github.io/Hbase/index.html
The DetailAst will be
The current Also can I get some help with the pitest2? I am not sure why it fails......Thx in advance! |
There should be no violation. The html generated by the Javadoc tool is
it should be same as
May be this check should be a Java check, not Javadoc check, as this one. |
@0blivious ping. Please let us know if you have a problem with the issue. |
2e83751
to
434db54
Compare
Sorry was a bit busy for these few days. I have updated the implementation to skip * in front. I have some problems with the CI though. Can tell me how to interpret the pitest result and fix it? |
434db54
to
59e065b
Compare
Please see #7797 on an introduction to pitest and some helpful links. |
59e065b
to
bcedffd
Compare
05a02e1
to
03ea93d
Compare
@0blivious , please reply "done" to each my point to make sure nothing is missed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please regenerate report , there should be no violations - https://0blivious.github.io/sevntu-checkstyle/index.html
https://0blivious.github.io/Orekit/index.html#A36 valid violation
#A36 | warning | JavadocMissingWhitespaceAfterAsterisk | Missing a whitespace after the leading asterisk. | 52 | 8
, but .... take a look at source file
why there is no violation at line 55:
52 /**Index of the latest closest neighbor.*/
53 private int latestClosestNeighbor;
54
55 /**Simple constructor.
56 * @param interpolationPoints number of points used in the interpolation
57 */
58 public ShortPeriodicsInterpolatedCoefficient(final int interpolationPoints) {
item to improve:
...javadocmissingwhitespaceafterasterisk/InputJavadocMissingWhitespaceAfterAsteriskInvalid.java
Outdated
Show resolved
Hide resolved
dd33c10
to
4528946
Compare
I have regenerated the report and it report violation at line 55 correctly. However, the sevntu-checkstyle still report the same violation. It seems that it still test the old code. I am not sure why this happen...... |
@0blivious If you are referring to the diff script regression, it does not update the repositories automatically. You will have to do this manually. |
...javadocmissingwhitespaceafterasterisk/InputJavadocMissingWhitespaceAfterAsteriskInvalid.java
Outdated
Show resolved
Hide resolved
@0blivious , please remove all git clones from chekcstyle-tester to let him get latest sources. |
4528946
to
5484093
Compare
@romani Hi I have updated the report and fix the input file. Can I get your review on this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as it is change of code, please regenerate report, please confirm that these is not diff from previous implementation in violations.
last minor:
...m/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMissingWhitespaceAfterAsteriskCheck.java
Outdated
Show resolved
Hide resolved
7576f53
to
f72f7a4
Compare
@0blivious , please rebase on latest master to resolve wercker issue. |
f72f7a4
to
c32a0f6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as we change code, please do not forget to regenerate regression diff report.
new item:
if (textNode != null | ||
&& textNode.getType() != JavadocTokenTypes.EOF | ||
&& !hasWhitespaceAfterAsteriskBeforeText(textNode)) { | ||
log(textNode.getLineNumber(), textNode.getColumnNumber(), MSG_KEY); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unfortunately I still do not like design .....
name hasWhitespaceAfterAsteriskBeforeText
is not same as logic inside, it will be a problems in future.
please do:
if (textNode != null
&& textNode.getType() != JavadocTokenTypes.EOF) {
int lastAsterisPosition = getLastLeadingAsterik(....)
if (!isLast(lastAsterisPosition) && !isWhitespace(lastAsterisPosition +1 )) {
log(textNode.getLineNumber(), textNode.getColumnNumber(), MSG_KEY);
}
}
and please add tests case with tabs after leading asterik.
Please create new Input file for this as tabs are forbidden in java files in our repo, so we need to suppress violation on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please create new Input file for this as tabs are forbidden in java files in our repo, so we need to suppress violation on it.
sad leftover #8019, we do not validate such code for bad whitespaces.
c32a0f6
to
2f4f0e5
Compare
0719ba2
to
9ab416d
Compare
Issue #7183
Contribution PR:
checkstyle/contribution#454
checkstyle/contribution#454 (this link was added to satisfy
verify-no-exception-configs
build item)Regression report:
https://0blivious.github.io/7183/index.html
Old regression report
https://0blivious.github.io/index.html
Sevntu-checkstyle PR (merged)
sevntu-checkstyle/sevntu.checkstyle#806
Checkstyle PR
#7883