Skip to content

Instantly share code, notes, and snippets.

View anapaulagomes's full-sized avatar

Ana Paula Gomes anapaulagomes

View GitHub Profile
@anapaulagomes
anapaulagomes / git-pre-commit-hook-django-migrations
Last active July 8, 2019 15:39 — forked from mlorant/git-pre-commit-hook-django
Django - Avoid duplicate in migration names before committing changes in Git
#!/usr/bin/python
"""
Pre-commit hook for git written in Python.
Check if there is any migration number used more than one in each
migrations folder of South or Django >= 1.7.
You can install this pre-hook by executing the command:
ln -s ./git-pre-commit-hook .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
Or by calling the current script or check_migrations_files() in your
own file.
@anapaulagomes
anapaulagomes / pre-push
Last active June 16, 2018 13:46 — forked from msiemens/pre-commit.sh
My git pre-push hook
#!/bin/bash
echo "Running tests..."
pytest tests/
code=$?
if [ "$code" -eq "0" ]; then
echo
echo
echo "All tests passed. Continuing..."