简体   繁体   中英

Sonar category of TODO warnings

In my code I have different types of TODO items:

  • Some are meant to be like "this totally needs to be done"
  • Others are more like "if you ever feel bored, why not add this?"

An example for this would be in my IntelliJ-Plugin: there is a refresh method in a VirtualFileSystem which would be kinda user friendly to be implemented eventually, but everything works perfectly fine even without it, so it is more like a // NICETOHAVE: and not a // TODO: .

I like to add comments like that to the code but since I am using Sonar to inspect my code base this creates some nasty inspection warnings and IntelliJ keeps bugging me when pushing my code in VCS.

So my question is, is there some other way to annotate things in my code that could be nice to implement eventually but it does not matter if you ever come to actually do it while still having some nice highlighting?

There are only two rules tracking comments : TODO and FIXME

If you want to track other comments you might be better of writing your custom rule (because there is no plan to add customization to those rules) and you can get inspiration of how to do this by looking at the source code of the java plugin : FixMeTagPresenceCheck and CommentContainsPatternChecker

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