Skip to content

A pre-commit hook for git that checks for the presence of DEBUG comments

License

Notifications You must be signed in to change notification settings

orthecreedence/git-debug-hook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

What does this do?

This is a pre-commit hook you put in your git repo.

It allows you to write comments in your code like this:

// DEBUG: remove this log
console.log('some debug stuff: ', debug_val);

When you try to commit this file, it bitches at you, saying:

Please address the DEBUG comments in following files before committing:

  user.js

Boom! You can't commit the file until you remove the DEBUG comment, which is a great reminder to not commit your debug code.

Usage

Simply put the file pre-commit.debug-comments into .git/hooks/pre-commit. You can also host this repo somewhere else and symlink .git/hooks/pre-commit to git-debug-hook/pre-commit.debug-comments.

That's it!

Supported languages

The hook detects language by file extension (ie, .js -> javascript, .lisp -> lisp, etc).

  • javascript
  • rust
  • html
  • lisp
  • (ba)sh
  • handlebars

Contributing

If you want support for a certain language, don't open an issue, I'll probably just ignore it (being realistic here).

Fork the project and open a pull request. Be sure to also add your language to the supported language list or I'll contact the authorities. GOOD DAY, SIR/MADAM/NON-GENDER-CONFORMING-FORMAL-TITLE.

License

MIT. Yay.

About

A pre-commit hook for git that checks for the presence of DEBUG comments

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages