The nice thing about the snippet is that it only counts added lines, not removed, so you can clean code with this pre-commit active, but never make it worse.
FORBIDDEN='declaim\|break' git diff --cached | grep '^+' | grep -n $FORBIDDEN && \
echo "COMMIT REJECTED Found '$FORBIDDEN' references. Please remove them before commiting" &&\
exit 1
No hay comentarios:
Publicar un comentario