astral-sh/ruff

TD003 error in regex or misleading error message

Open

#16,519 opened on Mar 5, 2025

View on GitHub
 (7 comments) (3 reactions) (0 assignees)Rust (2,088 forks)batch import
documentationhelp wantedrule

Repository metrics

Stars
 (47,527 stars)
PR merge metrics
 (Avg merge 5d 4h) (463 merged PRs in 30d)

Description

Summary

Rule TD0003 ('Missing issue link for this TODO') allows for 4 different forms off issue link, however only explicit link and #123 works anywhere in the TODO comment, 123 and FOOBAR-1234 have to be put alone in the separate line.

  1. While it may be reasonable for digits alone version I think it would be much more convenient to search for FOOBAR-1234 form in the whole TODO comment.
  2. This difference in behavior is not stated anywhere clearly, nor in the error message neither in ruff docs (it can be only inferred form the examples) which is very confusing for the user.

Version

0.9.3

Contributor guide