ruff/crates/ruff_linter/resources/test/fixtures/flake8_todos/TD003.py
Dylan d2656e88a3
[flake8-todos] Allow VSCode GitHub PR extension style links in missing-todo-link (TD003) (#15519)
## Summary
Allow links to issues that appear on the same line as the TODO
directive, if they conform to the format that VSCode's GitHub PR
extension produces.

Revival of #9627 (the branch was stale enough that rebasing was a lot
harder than just making the changes anew). Credit should go to the
author of that PR though.

Closes #8061

Co-authored-by: Martin Bernstorff <martinbernstorff@gmail.com>
2025-01-15 23:47:33 +00:00

43 lines
983 B
Python

# TDO003 - accepted
# TODO: this comment has a link
# https://github.com/astral-sh/ruff/issues/3870
# TODO: this comment has an issue
# TDO-3870
# TODO: the link has an issue code of the minimum length
# T-001
# TODO: the issue code can be arbitrarily long
# ABCDEFGHIJKLMNOPQRSTUVWXYZ-001
# TDO003 - errors
# TODO: this comment has no
# link after it
# TODO: here's a TODO with no link after it
def foo(x):
return x
# TODO: here's a TODO on the last line with no link
# Here's more content.
# TDO-3870
# TODO: here's a TODO on the last line with no link
# Here's more content, with a space.
# TDO-3870
# TODO: here's a TODO without an issue link
# TODO: followed by a new TODO with an issue link
# TDO-3870
# foo # TODO: no link!
# TODO: https://github.com/astral-sh/ruff/pull/9627 A todo with a link on the same line
# TODO: #9627 A todo with a number on the same line
# TODO: A todo with a random number, 5431
# TODO: here's a TODO on the last line with no link