Skip to content
This repository has been archived by the owner on Feb 11, 2025. It is now read-only.

Add rule to ensure consistent TODO comments #17

Closed
mrmckeb opened this issue May 4, 2022 · 2 comments
Closed

Add rule to ensure consistent TODO comments #17

mrmckeb opened this issue May 4, 2022 · 2 comments
Milestone

Comments

@mrmckeb
Copy link
Contributor

mrmckeb commented May 4, 2022

We've seen varied approaches to this, and it would be good to standardise - as it will help us build tooling around this later.

@vuki656
Copy link

vuki656 commented Sep 28, 2022

We've written a rule that enforces all TODOs and FIXMEs to have a link included. This prevents stale TODOs and FIXMEs from never being fixed.

It enforces you to put a link to your issue board so that they are always visible when planning sprints.

Usage example in our config

@EndangeredMassa
Copy link

TODOs with Links

I don't think we should require a link for TODO comments. I agree with the sentiment, but this would constrain what TODOs can be used for. On my team, for example, we use TODOs to describe intent of possible changes in the future. It's a way to capture some intent and direction for the code that's not a task that we want to track.

Sometimes TODOs are tasks that we want mentioned in the code AND tracked as a task. For those, we definitely want links.

TODO Format

I agree with enforcing all TODO comments to have the same format. My preference is:

// TODO: do something

/*
  TODO: do something
  with some more context
*/

@mrmckeb mrmckeb added this to the v6 milestone Aug 29, 2023
@leerob leerob closed this as completed Feb 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants