Skip to content

Instantly share code, notes, and snippets.

@lsemel
lsemel / flakes.py
Last active December 15, 2015 03:49 — forked from aniav/flakes.py
Run pyflakes against a Django project, with option to exclude directories/files
from __future__ import absolute_import
import ast
import os
from pyflakes import checker, messages
import sys
import fnmatch
from optparse import make_option
from django.conf import settings
from django.core.management.base import BaseCommand
@lsemel
lsemel / pre-commit
Created March 5, 2012 22:41 — forked from jjmalina/pre-commit
Git pre-commit hook
#!/usr/bin/env python
import os
import re
import subprocess
import sys
modified = re.compile('^(?:M|A)(\s+)(?P<name>.*)')
CHECKS = [