显示HN:DebtBomb – 让TODO到期并自动创建Jira工单
Show HN: DebtBomb – Make TODOs expire and automatically create Jira tickets

原始链接: https://github.com/jobin-404/debtbomb

## DebtBomb:强制清理技术债务 DebtBomb 是一款跨语言工具,旨在防止技术债务无限累积。它扫描源代码注释中的“债务炸弹”——附加到临时代码或权宜之计的时间限制标签(使用 `@debtbomb`)——并在**这些截止日期过期时使 CI 构建失败**。 这迫使团队解决债务问题,而不是让其持续存在。DebtBombs 需要一个过期日期,并可以选择包含所有者和工单信息以明确责任。 **主要特性:** * **语言无关:** 通过解析注释,适用于任何语言。 * **CI 集成:** 在债务过期时使构建失败,并提供 `--warn-in-days` 选项以进行主动提醒。 * **报告:** 生成按所有者、文件夹、原因和紧急程度分类的债务摘要。 * **可定制:** 使用 `.debtbombignore` 文件排除特定路径,并自动跳过非源代码文件以提高速度。 安装通过 `go install` 即可轻松完成。更多信息和完整命令参考请访问 [GitHub](https://github.com/jobin-404/debtbomb)。

## DebtBomb:使用过期时间解决技术债 开发者 jjdev8157 推出 DebtBomb,一个命令行工具,旨在对抗项目中永久存在的“临时”代码(例如 `TODO` 注释)。DebtBomb 不使用无期限的 `TODO`,而是要求开发者为这类代码分配到期日期。 当技术债“炸弹”到期时,CI 管道会失败,从而强制解决问题——要么移除代码,要么有意延长截止日期。最近添加的功能进一步自动化了此过程,可以创建包含相关详细信息(文件路径、所有者、代码片段)的 Jira 工单,并通过 Slack、Discord 或 Teams 发送通知。 开发者正在寻求反馈,特别是来自管理长期代码库的团队,以验证这种方法是否比传统的 `TODO`、代码检查工具或手动创建工单更有效。一位评论者建议使用专门的任务管理系统(如 Jira)代替嵌入代码库中的 `TODO`。 [https://github.com/jobin-404/debtbomb](https://github.com/jobin-404/debtbomb)
相关文章

原文

DebtBomb Logo

DebtBomb is a cross-language technical-debt enforcement tool that scans source code comments for time-limited “debt bombs” and fails CI when they expire.

It lets teams ship temporary hacks safely by attaching an expiry date to them. When the date passes, the build fails — forcing the debt to be cleaned up instead of silently rotting forever.


Every codebase has comments like:

TODO: remove later
FIXME: temporary workaround

They almost never get removed.

DebtBomb gives those comments a deadline.

Temporary code is allowed — but it must be time-bounded, owned, and visible.


go install github.com/jobin-404/debtbomb/cmd/debtbomb@latest

If the debtbomb command is not found, add Go’s bin directory to your PATH:

macOS / Linux

echo 'export PATH="$HOME/go/bin:$PATH"' >> ~/.zshrc  # or ~/.bashrc
source ~/.zshrc

Windows Add %USERPROFILE%\go\bin to your PATH environment variable.


git clone https://github.com/jobin-404/debtbomb.git
cd debtbomb
go build -o debtbomb cmd/debtbomb/main.go

For a complete reference of all commands and flags, see CLI Reference.

Fails with exit code 1 if any debt bomb is expired.


Warn before things explode:

debtbomb check --warn-in-days 7

This surfaces expiring debt in CI without blocking releases yet.


debtbomb list
debtbomb list --expired
debtbomb list --json

Generate a high-level summary of technical debt:

debtbomb report
debtbomb report --json

This shows debt breakdown by:

  • Owner
  • Folder/Module
  • Reason
  • Urgency (Expired, < 30 days, < 90 days)

DebtBomb looks for comments containing @debtbomb. It works with any language because it only reads comments.

Supported comment styles:


// @debtbomb(expire=2026-02-10, owner=pricing, ticket=JIRA-123)

// @debtbomb
//   expire: 2026-02-10
//   owner: pricing
//   ticket: JIRA-123
//   reason: Temporary surge override

Field Description
expire Required. YYYY-MM-DD
owner Team or person responsible
ticket Issue tracker reference
reason Why this debt exists

Create a .debtbombignore file to exclude paths:

migrations/
legacy/
src/generated/*.go

DebtBomb skips files that are not human-written source.

Directories

  • node_modules, vendor, .venv, __pycache__
  • dist, build, out, target, bin, pkg, obj
  • .git, .svn, .hg
  • .idea, .vscode, .terraform

Files

  • Images, videos, archives, executables
  • PDFs and office documents
  • Minified files (.min.js, .min.css)
  • Lock files
  • Any file larger than 1MB

This keeps it fast even on large repos.


MIT


联系我们 contact @ memedata.com