Android的皮棉插件 - 设置自定义警告/错误,应检查 [英] Android Lint Plugin - set custom warning / error that should be checked

查看:490
本文介绍了Android的皮棉插件 - 设置自定义警告/错误,应检查的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是,如果有一种方法可以增加皮棉插件自定义的检查,它应该提醒我关于建立一个版本之前。例如,我想它来检查所有的光标,为InputStream 对象在我的code,如果它们被关闭,或检查我的$ C $下 // TODO: // FIXME:

My question is if there is a way to add to lint plugin a custom check which it should warn me about before building a version. For example I want it to check all Cursor, InputStream objects in my code if they are closed, or to check my code for //TODO:, //FIXME:.

任何想法,如果有任何一种方式做到这一点,甚至不与林特插件?

Any ideas if there is any kind of way to do that, or even not with Lint Plugin?

在此先感谢!

推荐答案

是的,你可以添加自定义的检查;看<一href="http://tools.android.com/tips/lint/writing-a-lint-check">http://tools.android.com/tips/lint/writing-a-lint-check和<一href="http://tools.android.com/tips/lint-custom-rules">http://tools.android.com/tips/lint-custom-rules 。

Yes, you can add custom checks; see http://tools.android.com/tips/lint/writing-a-lint-check and http://tools.android.com/tips/lint-custom-rules .

有关的具体问题,请注意,有21.1看起来在评论新皮棉检查。它不寻求TODO或FIXME;相反,它抱怨如果找到注释标记STOPSHIP。如果你想添加的待办事项或FIXME规则,您可能希望它的基础上,办理入住手续。

For your specific question, note that there's a new lint check in 21.1 which looks at comments. It doesn't look for TODO or FIXME; instead, it complains if it finds the comment marker "STOPSHIP". If you want to add a rule for todo or fixme, you might want to base it on that check.

这篇关于Android的皮棉插件 - 设置自定义警告/错误,应检查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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