Eliminate the undocumented TODOs with todocheck

栏目: IT技术 · 发布时间: 5年前

内容简介:Yesterday, I releasedWay too often, we let leftover TODOs slip into our main branch, which leaves your coworkers puzzles, looking at it a year from now.They’re thinking – what did I mean by “TODO: Move this to the users package”? What is the users package?

Yesterday, I released todocheck – a new kind of static code analyser for annotated TODOs.

Way too often, we let leftover TODOs slip into our main branch, which leaves your coworkers puzzles, looking at it a year from now.

They’re thinking – what did I mean by “TODO: Move this to the users package”? What is the users package? It doesn’t seem to exist anymore.

todocheck helps you fix this by forcing you to mark all your TODOs against an existing, open issue in your issue tracker.

That way, if you, at some point, close the issue, thinking you’re done, the CI pipeline will sparkle in red as there is an open, unaddressed TODO in your main branch.

No longer can developers close a half-baked issue, rushing for the weekly sprint review to say “I’m done!”.

How todocheck works

You run todocheck as a standalone binary from the root of your project and it looks for issues with the following format:

// TODO J123: Fix this typo
func fuu() {
    ...
}

In case the linked issue J123 is open,  todocheck will not report any error. In case you close the issue or it doesn’t exist, todocheck will show an error:

ERROR: Issue is closed.
myproject/main.go:12: // TODO J123: Fix this typo

ERROR: Issue doesn't exist.
myproject/main.go:14: // TODO J321: A non-existent issue

If there is an unannotated TODO in your code base, todocheck will also report it as a malformed  TODO :

ERROR: Malformed todo.
myproject/main.go:16: // TODO - This is not a valid annotated todo

Only TODO s with valid, open issues are allowed to exist in the codebase.

Eliminate the undocumented TODOs with todocheck

By integrating todocheck in your development workflow & CI pipeline, you can ensure that there will be no half-baked issue closed with pending TODO s in the codebase.

Does todocheck work with my language?

You can see the list of supported programming languages here .

There is also support for various public & private issue trackers. See the list here .

But your favorite language/issue tracker is not in the list?

Then feel free to open an issue & describe your needs. Oftentimes, adding support for new languages/issue trackers is a matter of configuration, so you might see your tool in the above lists pretty soon. Here is an example of such a request.

Conclusion

If you want to learn more about included features & configurations, consult the project’s README .

Why don’t you give todocheck a try right now? Download the latest release & check out the Quickstart section to get started in no-time.

Like the project? Show some love by :star:-ing it on GitHub .


以上所述就是小编给大家介绍的《Eliminate the undocumented TODOs with todocheck》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

数据结构、算法与应用

数据结构、算法与应用

(美)Sartaj Sahni / 汪诗林、孙晓东、等 / 机械工业出版社 / 2000-01 / 49.00

本书是关于计算机科学与工程领域的基础性研究科目之一――数据结构与算法的专著。 本书在简要回顾了基本的C++ 程序设计概念的基础上,全面系统地介绍了队列、堆栈、树、图等基本数据结构,以及贪婪算法、分而治之算法、分枝定界算法等多种算法设计方法,为数据结构与算法的继续学习和研究奠定了一个坚实的基础。更为可贵的是,本书不仅仅介绍了理论知识,还提供了50多个应用实例及600多道练习题。 本书......一起来看看 《数据结构、算法与应用》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

在线进制转换器
在线进制转换器

各进制数互转换器

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具