-
Notifications
You must be signed in to change notification settings - Fork 145
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 #734: New check 'Jsr305AnnotationsCheck' #742
Conversation
PMD failures should be fixed. Once PMD is fixed, we can start looking over the check. |
@rnveach continuing here as you proposed. I have now moved the test input files to src/test/resources. There are now those PMD failures left:
These warnings result from the construction used to run the check on input files:
The How do you propose to deal with this? |
Yes, thats the correct folder and output we are looking for.
This. If you know such a project, you can add it to |
...cks/src/test/java/com/github/sevntu/checkstyle/checks/coding/Jsr305AnnotationsCheckTest.java
Outdated
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.
I won't be reviewing your code until the CI is green. If you need any help on anything please just ask.
...cks/src/test/java/com/github/sevntu/checkstyle/checks/coding/Jsr305AnnotationsCheckTest.java
Outdated
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.
@mbert I need time to look over your check. I have marked some minor things but they don't address the implementation of your check and it's properties.
I still ask if there is some way to make the check simplier to read as the single file is more than 1000 lines.
...cks/src/test/java/com/github/sevntu/checkstyle/checks/coding/Jsr305AnnotationsCheckTest.java
Outdated
Show resolved
Hide resolved
...-sevntu-plugin/src/com/github/sevntu/checkstyle/checks/coding/checkstyle-metadata.properties
Outdated
Show resolved
Hide resolved
...sonar-plugin/src/main/resources/com/github/sevntu/checkstyle/sonar/checkstyle-extensions.xml
Outdated
Show resolved
Hide resolved
...cks/src/test/java/com/github/sevntu/checkstyle/checks/coding/Jsr305AnnotationsCheckTest.java
Outdated
Show resolved
Hide resolved
...-sevntu-plugin/src/com/github/sevntu/checkstyle/checks/coding/checkstyle-metadata.properties
Outdated
Show resolved
Hide resolved
...-sevntu-plugin/src/com/github/sevntu/checkstyle/checks/coding/checkstyle-metadata.properties
Outdated
Show resolved
Hide resolved
Done that. Here's the report: https://mbert.github.io/sevntu.checkstyle/reports/diff/index.html
I don't know of any public project using the plugin. That's why I provided a zip archive with an example project. For your convenience, here it is again: example-webservice.zip |
Thanks I missed it before. Please run this through the report generation as I don't see it listed in https://mbert.github.io/sevntu.checkstyle/reports/diff/index.html . We want to see the results of your check on this project that uses the annotation to further validate your changes. You should be able to add a line to the projects properties like:
The report looks generated correctly. I will use it as I start to review your check. |
Done. Here's the report: example-webservice-diff.zip |
Thank you, I am running into two issues here:
[edit] Partly replying to myself here: in order to speed things up I have now made the changes that hopefully bring the CI build to "green". First screenshot: missing DTD: Second screenshot: output of |
OK, so now we have one issue left in Job 1714.6: There are two problems mentioned here:
Any idea? |
@mbert I am already started to review your PR.
Last CI item can't be fixed until your check is added to an external file in another repo, but adding it before this PR is finished will cause issues since it is technically a check that doesn't exist.
It is a false error in CI. I believe it is the command that we are using that requires something more for the DTD. We need to add an option to the command to ignore DTD to prevent this error from printing. |
@romani moving your questions here.
I have rechecked. There isn't any such file generated under diff. I ran the tool with this command line:
And my example-webservice.properties file looks like this (as proposed by @rnveach):
Please let me know if there's anything I need to change.
See above: #742 (comment)
I tried some search the other day. The problem from my side is that all the code I know that uses these annotations is closed source. I can try again. |
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.
you can find jsr305 annotations usage by smth like https://github.com/search?l=Java&q=ParametersAreNullableByDefault&type=Code
please squash all commit to single commit.
have rechecked. There isn't any such file generated under diff. I ran the tool with this command line
@rnveach , we need your assistance.
items to improve:
sevntu-checks/src/main/resources/com/github/sevntu/checkstyle/checks/coding/messages.properties
Outdated
Show resolved
Hide resolved
...ources/com/github/sevntu/checkstyle/checks/coding/InputJsr305AnnotationsCheckWithArrays.java
Outdated
Show resolved
Hide resolved
...-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/Jsr305AnnotationsCheck.java
Outdated
Show resolved
Hide resolved
...-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/Jsr305AnnotationsCheck.java
Outdated
Show resolved
Hide resolved
...-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/Jsr305AnnotationsCheck.java
Outdated
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.
Few more items:
...-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/Jsr305AnnotationsCheck.java
Outdated
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.
probably last items to improve:
...-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/Jsr305AnnotationsCheck.java
Outdated
Show resolved
Hide resolved
...-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/Jsr305AnnotationsCheck.java
Outdated
Show resolved
Hide resolved
...-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/Jsr305AnnotationsCheck.java
Outdated
Show resolved
Hide resolved
...-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/Jsr305AnnotationsCheck.java
Show resolved
Hide resolved
...-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/Jsr305AnnotationsCheck.java
Outdated
Show resolved
Hide resolved
Here's an extended Checkstyle Tester run result with 8 projects: https://mbert.github.io/sevntu-checkstyle/checkstyle-tester/index.html |
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.
thanks a lot for your time to finish it.
Here's an extended Checkstyle Tester run result with 8 projects
I have problem to open source code from report
https://mbert.github.io/sevntu-checkstyle/checkstyle-tester/diff/example-webservice/xref/home/md/src/contribution/checkstyle-tester/repositories/example-webservice/src/main/java/org/example/webservice/service/impl/PingServiceImpl.java.html#L79
please fix.
please squash all new Check related commits in one (you can keep https update in separate commit of this PR).
I always do review from scratch as I never did it before, so accumulation of commits does not help me, if you squash all github still be able to show diff between you previous remote commit and current.
items to improve:
...-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/Jsr305AnnotationsCheck.java
Outdated
Show resolved
Hide resolved
...-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/Jsr305AnnotationsCheck.java
Outdated
Show resolved
Hide resolved
...-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/Jsr305AnnotationsCheck.java
Show resolved
Hide resolved
...-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/Jsr305AnnotationsCheck.java
Outdated
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.
item to improve:
...-sevntu-plugin/src/com/github/sevntu/checkstyle/checks/coding/checkstyle-metadata.properties
Outdated
Show resolved
Hide resolved
33129d0
to
04cb7fa
Compare
Please replace all cases of "protected" with private or public. Inner classes should be ready to simply moved to outside or we should treat them same as outside classes |
52478cf
to
b09ac78
Compare
Done that for a number of occurrences. Since the inner classes for handling the different kinds of definitions are based on abstract base classes, there are some cases of |
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.
@rnveach , plase finalize.
Last item to improve:
...sonar-plugin/src/main/resources/com/github/sevntu/checkstyle/sonar/checkstyle-extensions.xml
Outdated
Show resolved
Hide resolved
3f1d7c5
to
acd1edd
Compare
@mbert There are PMD failures. See https://travis-ci.org/sevntu-checkstyle/sevntu.checkstyle/jobs/538137903#L917 . I will try to begin reviewing this PR. |
This problem still exists. Once new items are done, report can be regenerated to fix this. |
...-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/Jsr305AnnotationsCheck.java
Outdated
Show resolved
Hide resolved
...-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/Jsr305AnnotationsCheck.java
Show resolved
Hide resolved
...-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/Jsr305AnnotationsCheck.java
Show resolved
Hide resolved
...-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/Jsr305AnnotationsCheck.java
Show resolved
Hide resolved
...-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/Jsr305AnnotationsCheck.java
Outdated
Show resolved
Hide resolved
sevntu-checks/src/main/resources/com/github/sevntu/checkstyle/checks/coding/messages.properties
Outdated
Show resolved
Hide resolved
...-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/Jsr305AnnotationsCheck.java
Outdated
Show resolved
Hide resolved
...-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/Jsr305AnnotationsCheck.java
Outdated
Show resolved
Hide resolved
...-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/Jsr305AnnotationsCheck.java
Show resolved
Hide resolved
Yep, sorry, those slipped my attention. It looks like the PMD settings conflict with the CheckStyle settings when it comes to calling constructors of private inner classes. Consider line 491:
I have now set it to |
e5227c0
to
f152f57
Compare
@mbert I assume you missed the review items listed inside the "Load more..." section. |
I am fine with this for now. |
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.
this is the last change, sorry for the delay.
...-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/Jsr305AnnotationsCheck.java
Outdated
Show resolved
Hide resolved
New check will have to be added to https://github.com/checkstyle/contribution/blob/master/checkstyle-tester/checks-sevntu-error.xml before we can merge this PR. |
Do I need to open a PR for this? Or are you guys taking care of it? |
@mbert please open a PR for it. |
@mbert , thank you very much for your huge effort to make it happen. |
This PR is a port of the existing independent JSR305CheckstylePlugin into the sevntu ecosystem.
Documentation and discussion can be found in issue #734.