DEV Community

Jesse M. Holmes
Jesse M. Holmes

Posted on

Fix This Before Commit!

I saw this beauty today during a code review, and it brought a set of tools to mind:

{/* Fix this before commit  */}
{true && <Locations locationOptions={locationOptions} />}
Enter fullscreen mode Exit fullscreen mode

ToDo Extensions for VS Code

There are a number of extensions that will take a comment like \\TODO: Fix this before commit and highlight it. If color coordination is your strong point, some of them allow you to customize your comment highlights according to the text so that, e.g., \\WONTFIX can be a pretentious shade of blue. Others will scan your code for such comments and compile them into a tree in your sidebar. Whatever your preference, just make sure you're utilizing a productivity tool that will catch your attention before your unfixed commit makes it to production. Hint: Writing tests aren't just a good idea—they're preventative in nature!

Obviously I am not the first to write about this:

Comment below with your favorites!

Top comments (2)

Collapse
 
rgaiken profile image
rgaiken

I like having a precommit hook that checks my added lines of code for "deleteme" (case insensitive).

Then when I inevitably forget to remove the deleteme code, I get reminded of it before I can even think of submitting it for review

Collapse
 
codemouse92 profile image
Jason C. McDonald

I use this convention myself! Comment Anchors is my favorite extension for this.