简体   繁体   中英

Clear SonarLint Annotation Occurrence in Eclipse Without SonarQube

I'm working for a client that wants SonarLint used on their projects. Their IDE of choice is Eclipse. They do not have SonarQube. What I am looking for is a way to clear out the SonarLint annotation for a particular instance of a rule violation, rather than disabling the rule altogether.

For example, the rule about removing commented out code is useful for finding code accidentally left behind after testing, but there are occasions where commented out code is left behind because the business is not yet clear on how they want a particular routine to function. It would be helpful to be able to clear that one instance of the rule violation annotation.

Is this even possible without SonarQube?

You should add on your code an annotation with the specific rule id, and add a comment to explain, eg :

@SuppressWarnings("squid:CommentedOutCodeLine") //code commented out because business is not yet clear

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM