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
Add SuppressionAnnotationFilter #368
Conversation
postponed to 1.14 |
@attatrol , can we finish this PR ? |
@attatrol, do you plan to finish this PR ? If you have no time, just let me know, I find another contributor to finish. |
@romani, |
@romani |
please look at others Checks, we use
I do not see any reason in field, please inline its value.
Why is it transient ?
make a single exit point from method. |
f146c28
to
ee72ab3
Compare
@romani,
i did as you said, and now i get 7 errors from JavadocStyle for the parts surrounded by {code} tag.
Please confirm whether it is my fault or it is a bug.
Done.
The modifier was "inherited" from the SupressionCommentFilter when i was newbie in Java. It was deleted.
Done. |
Travis need to be fixed - https://travis-ci.org/sevntu-checkstyle/sevntu.checkstyle/jobs/109062733#L512 Nothing is bad in your code https://blogs.oracle.com/darcy/entry/javadoc_tip_code_and_literal . |
@romani , |
DetailAstRootHolder.java
So, weak reference or TreadLocal ?
please override all getXXXXXXTokens methods SuppressionAnnotationFilter.java
weird or misplaced "...}" . The same for other examples.
name will match.
rename to "checkName" (without "s", as it is regexp and not a collection) Please make example for annotation
I do not understand reason of this option, please update Javadoc example(config + code sample) to make it clear.
please remove "Set" from name. Please do this for other fields too.
annotations vs modifiers ?! Terminology has to be consistent.
should be with "s" -
remove dead code.
make a static function for this, name of method will explain meaning of it.
why public ?
permittedChecksSet --> string --> 'expanded comment' !!!?? please make good names for all terms
please make it static, please verify all other methods to make them static.
please move
make it private and static and single return.
avoid "NOT" in method names as much as possible. please rename and refactor.
do not invent terminology use "match", method inner code already tell you this. |
033ebba
to
7648e66
Compare
@romani ,
i removed {
Actually it is a collection. It is used with regexp list
Javadoc paragraph 2 updated. By the way this annotation was the impetus for this filter creation.
Javadoc paragraph 5 updated.
method
Done, but it is impossible to make it static as it calls nonstatic method.
I made it private and single return, but it directly asks for a field, so i chose to leave it nonstatic.
Done, new method name is
Done, new method name is |
DetailAstRootHolder.java
Checkstyle is single thread application by design. So why ThreadLocal is required ?
rename to be "checkNames" BaseCheckTestSupport.java
Weird formatting. |
@romani ,
I thought it was a good idea to be consistent with analog class.
Done
Whole class is wierd formatted, i made this method consistent with the rest of the class. |
All events ? I did not found "certain" in config. What is "certain" ? Be exact.
Filter is suppression(hiding), annotation is suppression marker, but why check is smth is NOT smth that will be suppressed ?
permitted ?
I do not undrstand reason of this option at all. Please provide example why it is matter.
annotations --> anootationNames , str--> name.
make a single line.
Please let me know when message could be null, and when currentRoot is null ?
simple form ?
move IF to calling method. If you name method "reset....." do reset. In other case name method "resetLocalDataIfPossible". Name method in exactly as what it is doing.
currentRoot --> node |
It was there from the beginning. |
@attatrol , is there any change to finish this PR ? |
@romani, |
thanks a lot for answer. |
we try to get gid of all Holders in Checkstyle now , original issue in checkstyle repo might be fixed by new Xpath Filter - see checkstyle/checkstyle#1340 (comment) there is not future in this update and it is abandoned already. |
A new filter is added. It satisfies issue #1340.
checkstyle/checkstyle#1340
It suppresses events generated from code elements annotated by user defined annotations.
Here is a link to the xdocs entry for the filter:
https://gist.github.com/attatrol/699fd9863de8730dfc30
I was to add small changes to .travis.yml from the original, because somehow previous version errored:
https://travis-ci.org/attatrol/sevntu.checkstyle/jobs/72255048
[ERROR] Failed to execute goal org.eluder.coveralls:coveralls-maven-plugin:2.2.0:jacoco (default-cli) on project sevntu-checks: Processing of input or output data failed: Report submission to Coveralls API failed with HTTP status 422: Unprocessable Entity (Couldn't find a repository matching this job.) -> [Help 1]