声纳类别的TODO警告 [英] Sonar category of TODO warnings

查看:118
本文介绍了声纳类别的TODO警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的代码中,我有不同类型的TODO项目:

In my code I have different types of TODO items:


  • 有些意思是这完全需要完成

  • 其他人更像是如果你觉得无聊,为什么不加这个?

一个例子就是我的IntelliJ-Plugin:在 VirtualFileSystem 中有一个刷新方法有点用户友好,最终实现,但即使没有它,一切都很好,所以它更像是一个 // NICETOHAVE:而不是 / / TODO:

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:.

我想在代码中添加类似的注释,但由于我使用Sonar来检查我的代码库,因此创建了一些令人讨厌的检查警告和IntelliJ在VCS中推送我的代码时一直困扰着我。

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?

推荐答案

跟踪评论只有两条规则:TODO和FIXME

There are only two rules tracking comments : TODO and FIXME

如果你想跟踪其他评论你可能更好编写自定义规则(因为没有计划为这些规则添加自定义),您可以通过查看java插件的源代码获得如何执行此操作的灵感: FixMeTagPresenceCheck CommentContainsPatternChecker

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

这篇关于声纳类别的TODO警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆