Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
SuppressCommentFilter not working with ClassDataAbstractionCoupling when specified on class #977
Version tested: checkstyle 6.5
Working example with @SuppressWarning
Non working example with SuppressionCommentFilter
I noticed that if you put the // @cs-: just below the package declaration it does work. So this might not be a bug but a restriction on how checkstyle works. If so, just close this ticket.
Maybe you could update the documentation to clarify the fact that SuppressCommentFilter and SuppressWithNearbyCommentFilter should be put just above the violation (without other comments in between). Looking at the documentation I don't see the fact that it must be close specified. The fact that 2 @SuppressWarning can be put on the class but 2 // @cs- shouldn't isn't obvious.
referenced this issue
Jun 21, 2015
The problem was happened because the CLASS_DEF starts on the line where the @service annotation is placed. I will update the documentation.
There is an example in the xdoc of how to configure the SuppressWithNearbyCommentFilter check to suppress more than one comment.