跳到内容

missing-todo-link (TD003)

源自 flake8-todos 代码检查器。

作用

检查 TODO 注释是否与相关问题或工单的链接关联。

为什么这不好?

在 TODO 附近包含问题链接可以使解决者更容易获得有关问题的上下文。

示例

# TODO: this link has no issue

请使用以下方式之一代替

# TODO(charlie): this comment has an issue link
# https://github.com/astral-sh/ruff/issues/3870

# TODO(charlie): this comment has a 3-digit issue code
# 003

# TODO(charlie): https://github.com/astral-sh/ruff/issues/3870
# this comment has an issue link

# TODO(charlie): #003 this comment has a 3-digit issue code
# with leading character `#`

# TODO(charlie): this comment has an issue code (matches the regex `[A-Z]+\-?\d+`)
# SIXCHR-003