TODO and FIXME comments must have ownership

This page is not yet available in Spanish. We are working on its translation.
If you have any questions or feedback about our current translation project, feel free to reach out to us!

Metadata

ID: python-best-practices/comment-fixme-todo-ownership

Language: Python

Severity: Notice

Category: Best Practices

Description

When using TODO or FIXME, specify who write the annotation. It’s a best practice to remind you who created the annotation and have potential context and information about this issue.

Non-Compliant Code Examples

# TODO fix this function
def my_function():
    pass

# FIXME fix this function
def my_function():
    pass

# FIXME(): fix this function
def broken():
    pass

Compliant Code Examples

# TODO(bob) fix this function
def my_function():
    pass

# FIXME(julien) fix this function
def my_other_function():
    pass

# FIXME[julien] fix this function
def my_other_function():
    pass

# TODO[bob] fix this function
def my_function():
    pass

# TODO (amaan): fix this function
def broken():
    pass

# TODO (amaan.qureshi): fix this function too
def broken2():
    pass
https://static.datadoghq.com/static/images/logos/github_avatar.svg https://static.datadoghq.com/static/images/logos/vscode_avatar.svg jetbrains

Seamless integrations. Try Datadog Code Analysis