Skip to content

mbork/find-stale-comments

Repository files navigation

Find stale comments

Suppose you have this JavaScript code:

// Say hello to the world
console.log('Hello world!')

and at some point decide to make the message slightly cooler:

// Say hello to the world
console.log('Allons-y!')

but forget to update the comment?

If yes, this script is for you. It is intended to be run as a pre-commit hook and alert you if you changed some code but forgot to update the comment preceding it. It is intentionally simple so that it can be language-agnostic, so it assumes that a comment pertains to code between itself and the first empty line.

About

A script to be used in pre-commit hook to prevent changing code without changing the corresponding comment

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors