DEV Community

Jesse M. Holmes
Jesse M. Holmes

Posted on

3 2

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!

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

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.

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay