Skip to content

Instantly share code, notes, and snippets.

View mcchrish's full-sized avatar
🌏
🌧

Michael Chris Lopez mcchrish

🌏
🌧
View GitHub Profile
@mcchrish
mcchrish / pre-commit
Last active May 27, 2016 14:21 — forked from dy-dx/pre-commit
Git pre-commit hook to check for debugging codes and Standard JS violations in a Javascript project
#!/bin/bash
FILES_PATTERN='\.(css|less|scss|sass|html|ejs|js|jsx)(\..+)?$'
FORBIDDEN=( ">>>>>>" "<<<<<<" "======" "console.log" "debugger" )
# the exit code from `grep -E $FILES_PATTERN` gets swallowed unless the pipefail option is set
set -o pipefail
FORBIDDEN_FOUND=false