Sonar category of TODO warnings

2019-08-04 19:30发布

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?

1条回答
何必那么认真
2楼-- · 2019-08-04 20:04

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

查看更多
登录 后发表回答