-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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 #6723: new check: LeadingAsteriskAlignCheck #14643
Conversation
I've moved the check from And also I was facing error while running
the above error log was really long so I only added the starting part of it.
Can anyone explain me the reason for the above error?
I've added the documentation for the property |
I will complete the pending documentation work, is there anything else also to work on to complete this task? And also can anybody reply me here pls? #6723 (comment) |
looking for @romani @nrmancuso @rnveach @pbludov your help :) |
@Zopsss , I have been facing a similar error related to docs changes in my PR #14593 |
Something wrong with documentation, please debug failed test to see what it expects |
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.
Items
src/test/java/com/puppycrawl/tools/checkstyle/checks/LeadingAsteriskAlignCheckTest.java
Outdated
Show resolved
Hide resolved
src/main/java/com/puppycrawl/tools/checkstyle/checks/LeadingAsteriskAlignCheck.java
Outdated
Show resolved
Hide resolved
...-examples/resources/com/puppycrawl/tools/checkstyle/checks/leadingasteriskalign/Example2.txt
Outdated
Show resolved
Hide resolved
GitHub, generate site |
Hey @MANISH-K-07 I solved this error, I don't exactly remember how I did it but I inspected the other checks to see how their documentation is written and also inspected the methods that were throwing that error. I've pushed my changes, you can check it out. |
<li> | ||
<a href="https://github.com/search?q=path%3Aconfig%20path%3A**%2Fcheckstyle-checks.xml+repo%3Acheckstyle%2Fcheckstyle+LeadingAsteriskAlign"> | ||
Checkstyle Style</a> | ||
</li> |
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.
I've removed the Sun Style
usage from here as we're currently not using this check in sun_style.xml
, mvn clean verify
was also complaining about it. As discussed here #6723 (comment) if we're going to add usage of this Module to our Sun Style Guide then we can open an separate issue in the future once the implementation of this check is done.
Thanks for the info @Zopsss. But after digging in a bit deeper, my issue seems to be different. I'm not yet sure why but part of my doc changes are being reverted back by git at the end of validations. I suspected the problem being related to template macros and am working on resolving it as we speak !! Anyways, thanks for the help and good luck with this PR ;) @romani , It is taking longer than expected. Any suggestions on my PR #14593 would be helpful.... |
GitHub, generate site 🚀 |
Coverage is not met. I'm facing this error:
I've never faced coverage error before, I'm not able to understand how can I solve it. Can you guide me through this? @romani |
GitHub, generate site |
Generate html report https://github.com/checkstyle/checkstyle/wiki/How-to-run-certain-phases-and-validations#how-to-generate-ut-coverage-report and read in web how to deal with it. If still a problem, share report in your GitHub.io to let us guide you. |
Please consider #6723 (comment), we will get this merged much faster if we create lean implementation first. |
I solved it, but CI seems to be unhappy, I will look at those errors soon. And sorry for the delay, there were many bugs in the implementation of the check so it took a little bit longer to fix them, now the check is almost ready, we only need to translate error messages into different languages. I have a doubt though. How can we translate our error message into different languages? I saw that error messages in different languages are in encoded with some kind of format, can you guide me how can I translate the error messages into different languages with encoded format? @romani |
damn I spent many hours working on this issue and now we're thinking about changing the working of it 😿. The check is almost done, just need to translate the error messages into different languages ;( |
The work on this check has only begun :) You are about to spend many more hours in review + report generation and analysis + iterations on code changes and CI. The choice is up to you ultimately. Introducing new checks is one of the most difficult tasks in Checkstyle, and requires review from all maintainers. |
I'm okay with transitioning to Javadoc Check, but the new implementation might work differently from the current implementation based on the points I mentioned here: #6723 (comment) @nrmancuso |
c255bb4
to
c49c478
Compare
hey @romani @nrmancuso I was transitioning this check to javadoc as we discussed, I've completed the work but when running
It was showing error at As you can see in the second error, it is saying that the return value of before handling the null condition, the code was something like this: final String commentText = "*".concat(JavadocUtil.getNextSibling(ast).getText(); After handling the null condition, it is something like this: final DetailNode nextSibling = JavadocUtil.getNextSibling(ast);
final String commentText = nextSibling != null
? "*".concat(nextSibling.getText())
: ""; but now mvn clean verify is giving coverage not met error. Jacoco is showing yellow diamond on All the test cases were passing without handling this null condition, from what I think I guess the getNextSibling() method will never return null value for I was thinking maybe we can handle the null condition with the code I mentioned above but then it is giving |
also some files are giving should I fix them? or should I ignore them? I'll fix the other errors it is showing soon, mvn clean verify didn't gave me any of this error on my local setup so I didn't knew they existed. |
All CI must be green, you will need modify your code or find test cases to cover your code. |
Yeah I know but I was asking if I should fix the and also can you suggest me a situation where |
d022231
to
3be8df2
Compare
@nrmancuso just wanted to know that how much more time this module will require? The last generated regression report was fine, there were no false positives and the module was working fine. I also implemented the small new changes after that, based on maintainers suggestions. I want to get this PR merge before the ending of Community Bonding period ( 26th may ) so then I can start working on my project. |
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.
@nrmancuso just wanted to know that how much more time this module will require?
There is no way of telling, I think we can finish it this weekend if we try.
I had no idea that OptionalInt existed, thanks for sharing this here.
Items:
...in/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocLeadingAsteriskAlignCheck.java
Outdated
Show resolved
Hide resolved
...in/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocLeadingAsteriskAlignCheck.java
Outdated
Show resolved
Hide resolved
...in/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocLeadingAsteriskAlignCheck.java
Outdated
Show resolved
Hide resolved
...in/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocLeadingAsteriskAlignCheck.java
Outdated
Show resolved
Hide resolved
...in/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocLeadingAsteriskAlignCheck.java
Outdated
Show resolved
Hide resolved
...in/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocLeadingAsteriskAlignCheck.java
Outdated
Show resolved
Hide resolved
...in/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocLeadingAsteriskAlignCheck.java
Outdated
Show resolved
Hide resolved
...in/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocLeadingAsteriskAlignCheck.java
Outdated
Show resolved
Hide resolved
...ces/com/puppycrawl/tools/checkstyle/meta/checks/javadoc/JavadocLeadingAsteriskAlignCheck.xml
Outdated
Show resolved
Hide resolved
...in/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocLeadingAsteriskAlignCheck.java
Outdated
Show resolved
Hide resolved
Sure let's do it!
I also got to know about it from failing CIs :D |
fa728fc
to
77dd1d1
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.
Items:
config/checker-framework-suppressions/checker-nullness-optional-interning-suppressions.xml
Outdated
Show resolved
Hide resolved
...in/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocLeadingAsteriskAlignCheck.java
Outdated
Show resolved
Hide resolved
...in/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocLeadingAsteriskAlignCheck.java
Outdated
Show resolved
Hide resolved
daec786
to
4c81293
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.
Last item from me:
...in/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocLeadingAsteriskAlignCheck.java
Show resolved
Hide resolved
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.
Very good.
Thank you so much for guiding through this module and special thanks for today, helping me out even on weekends 😀 |
GitHub, generate report |
The diff report is fine, there is no false positives and module is working correctly @romani |
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.
last update:
* </li> | ||
* </ul> | ||
* | ||
* @since 10.17.0 |
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.
10.18.0 for all
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.
done. @romani
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.
ok to merge, thansk a lot for huge effort
Issue: #6723
Introduces a new Module called
LeadingAsteriskAlignCheck
Initially the check was for both types of comments, block comments & Javadoc comments and this PR was going to cover up the left over task of @bossever's PR.
But later on we decided to keep this check only for Javadoc comments, here is the conversion link, so I had to almost re-write the whole check implementation. But I want to thanks @bossever for the initial work, it really helped me to implement the check based on new requirements 😊✌️
Diff Regression projects: https://gist.githubusercontent.com/Zopsss/22adadb570e4deb95296917244c580b3/raw/29ea756eada8915637b76678db4f46048c198808/projects-to-test-on-for-github-action.properties
New module config: https://gist.githubusercontent.com/Zopsss/69dabf457713431bb900b6144dd7d3ef/raw/f90c10844d6c8645647b2806c6f6ddab910a6ece/JavadocLeadingAsteriskAlign.xml
Contrib repo PR: checkstyle/contribution#848
Fixing Leading Asterisks Alignment in Checkstyle repo: checkstyle/contribution#848
Fixing Leading Asterisks Alignment in Sevntu Repo: sevntu-checkstyle/sevntu.checkstyle#1035