Skip to content

Commit

Permalink
add pre-commit-config and precommit tox env
Browse files Browse the repository at this point in the history
trbs committed Jul 2, 2016
1 parent dca6986 commit 365e7cf
Showing 123 changed files with 426 additions and 119 deletions.
31 changes: 31 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
- repo: git://github.com/pre-commit/pre-commit-hooks
sha: 493665a5fc24deb2204fc48b8398be77e6c9e5d5
hooks:
- id: trailing-whitespace
- id: check-added-large-files
args:
- --maxkb=128
- id: check-ast
- id: check-case-conflict
- id: check-docstring-first
- id: check-json
- id: check-merge-conflict
- id: check-xml
- id: check-yaml
- id: detect-private-key
- id: end-of-file-fixer
- id: fix-encoding-pragma
- id: name-tests-test
args:
- --django
exclude: '^tests/testapp/|^tests/management/'
- repo: git://github.com/Lucas-C/pre-commit-hooks.git
sha: 0f5055d31f39ea3ac1f5335a0cca320200cd0c51
hooks:
- id: forbid-crlf
- repo: git://github.com/trbs/pre-commit-hooks-trbs.git
sha: c94ad5f83406a96b0750869e8930669af074975b
hooks:
- id: forbid-executables
exclude: manage.py|setup.py
- id: flake8
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -283,7 +283,7 @@ Changes:
- New: validators.py, NoControlCharactersValidator and NoWhitespaceValidator
- New: EmailNotificationCommand class, email exceptions from Django Commands
- Improvement: runserver_plus, enable threading by default and added --nothreading
- Improvement: runscript, better detection when import error occured in script
- Improvement: runscript, better detection when import error occured in script
- Improvement: runscript, use EmailNotificationCommand class
- Deprecation: deprecated UUIDField since Django 1.8 will have a native version.
- Removed: completely remove support for automatically finding project root.
@@ -377,7 +377,7 @@ Changes:

Changes:
- Feature: shell_plus, add --kernel option to start as standalone IPython kernel
- Feature: reset_db, Programatically determine PostGIS template
- Feature: reset_db, Programatically determine PostGIS template
- Feature: sqldiff, add support for PointField and MultiPolygonField
- Test: renamed test app
- Fix: runserver_plus, --print-sql for Django 1.7
2 changes: 1 addition & 1 deletion django_extensions/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
VERSION = (1, 6, 8, 'DEV')

# Dynamically calculate the version based on VERSION tuple
2 changes: 1 addition & 1 deletion django_extensions/admin/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
#
# Autocomplete feature for admin panel
#
2 changes: 1 addition & 1 deletion django_extensions/admin/widgets.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
import six
from django import forms
from django.contrib.admin.sites import site
2 changes: 1 addition & 1 deletion django_extensions/compat.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

import importlib
2 changes: 1 addition & 1 deletion django_extensions/conf/app_template/forms.py.tmpl
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from django import forms

# place form definition here
# place form definition here
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from django import template

register = template.Library()

1 change: 0 additions & 1 deletion django_extensions/db/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
# coding=utf-8
2 changes: 1 addition & 1 deletion django_extensions/db/fields/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
"""
Django Extensions additional model fields
"""
2 changes: 1 addition & 1 deletion django_extensions/db/fields/encrypted.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
import warnings

import six
2 changes: 1 addition & 1 deletion django_extensions/db/fields/json.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
"""
JSONField automatically serializes most Python terms to JSON data.
Creates a TEXT field with a default value of "{}". See test_json.py for
2 changes: 1 addition & 1 deletion django_extensions/db/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
"""
Django Extensions abstract base model classes.
"""
1 change: 0 additions & 1 deletion django_extensions/jobs/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
# coding=utf-8
1 change: 0 additions & 1 deletion django_extensions/jobs/daily/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
# coding=utf-8
2 changes: 1 addition & 1 deletion django_extensions/jobs/daily/cache_cleanup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
"""
Daily cleanup job.
2 changes: 1 addition & 1 deletion django_extensions/jobs/daily/daily_cleanup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
"""
Daily cleanup job.
1 change: 0 additions & 1 deletion django_extensions/jobs/hourly/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
# coding=utf-8
1 change: 0 additions & 1 deletion django_extensions/jobs/minutely/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
# coding=utf-8
1 change: 0 additions & 1 deletion django_extensions/jobs/monthly/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
# coding=utf-8
1 change: 0 additions & 1 deletion django_extensions/jobs/weekly/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
# coding=utf-8
1 change: 0 additions & 1 deletion django_extensions/jobs/yearly/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
# coding=utf-8
1 change: 0 additions & 1 deletion django_extensions/logging/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
# coding=utf-8
2 changes: 1 addition & 1 deletion django_extensions/logging/filters.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
import time
import logging
from hashlib import md5
1 change: 0 additions & 1 deletion django_extensions/management/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
# coding=utf-8
2 changes: 1 addition & 1 deletion django_extensions/management/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
import sys

from django.core.management.base import BaseCommand
2 changes: 1 addition & 1 deletion django_extensions/management/color.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
"""
Sets up the terminal color scheme.
"""
1 change: 0 additions & 1 deletion django_extensions/management/commands/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
# coding=utf-8
2 changes: 1 addition & 1 deletion django_extensions/management/commands/clean_pyc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
import fnmatch
import os
from os.path import join as _j
2 changes: 1 addition & 1 deletion django_extensions/management/commands/compile_pyc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
import fnmatch
import os
import py_compile
2 changes: 1 addition & 1 deletion django_extensions/management/commands/create_app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
import os
import re
import sys
2 changes: 1 addition & 1 deletion django_extensions/management/commands/create_command.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
import os
import sys
import shutil
2 changes: 1 addition & 1 deletion django_extensions/management/commands/create_jobs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
import os
import sys
import shutil
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
import os
import sys

2 changes: 1 addition & 1 deletion django_extensions/management/commands/describe_form.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
from django.apps import apps
from django.core.management.base import CommandError, LabelCommand
from django.utils.encoding import force_text
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
import logging

from django.conf import settings
2 changes: 1 addition & 1 deletion django_extensions/management/commands/export_emails.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
from csv import writer
from sys import stdout

2 changes: 1 addition & 1 deletion django_extensions/management/commands/find_template.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
import sys

from django.core.management.base import LabelCommand
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
from random import choice

from django.core.management.base import BaseCommand
2 changes: 1 addition & 1 deletion django_extensions/management/commands/graph_models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
import sys
import json

2 changes: 1 addition & 1 deletion django_extensions/management/commands/mail_debug.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
import asyncore
import sys
from logging import getLogger
2 changes: 1 addition & 1 deletion django_extensions/management/commands/notes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
from __future__ import with_statement

import os
2 changes: 1 addition & 1 deletion django_extensions/management/commands/passwd.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
import getpass

from django.contrib.auth import get_user_model
2 changes: 1 addition & 1 deletion django_extensions/management/commands/pipchecker.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
import json
import os
from distutils.version import LooseVersion
2 changes: 1 addition & 1 deletion django_extensions/management/commands/print_settings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
"""
print_settings
==============
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
import importlib

from django.conf import settings
2 changes: 1 addition & 1 deletion django_extensions/management/commands/reset_db.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
"""
originally from http://www.djangosnippets.org/snippets/828/ by dnordberg
"""
2 changes: 1 addition & 1 deletion django_extensions/management/commands/runjob.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
from django.core.management.base import LabelCommand

from django_extensions.management.jobs import get_job, print_jobs
2 changes: 1 addition & 1 deletion django_extensions/management/commands/runjobs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
from django.apps import apps
from django.core.management.base import LabelCommand

2 changes: 1 addition & 1 deletion django_extensions/management/commands/runprofileserver.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
"""
runprofileserver.py
2 changes: 1 addition & 1 deletion django_extensions/management/commands/runscript.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
import importlib
import sys
import traceback
2 changes: 1 addition & 1 deletion django_extensions/management/commands/runserver_plus.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
import logging
import os
import re
2 changes: 1 addition & 1 deletion django_extensions/management/commands/set_default_site.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
"""
set_default_site.py
"""
2 changes: 1 addition & 1 deletion django_extensions/management/commands/set_fake_emails.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
"""
set_fake_emails.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
"""
set_fake_passwords.py
2 changes: 1 addition & 1 deletion django_extensions/management/commands/shell_plus.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
import os
import six
import sys
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
import inspect
import os

2 changes: 1 addition & 1 deletion django_extensions/management/commands/show_templatetags.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
import warnings

from django.core.management import call_command
2 changes: 1 addition & 1 deletion django_extensions/management/commands/show_urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
import functools
import json
import re
2 changes: 1 addition & 1 deletion django_extensions/management/commands/sqlcreate.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
import socket
import sys

2 changes: 1 addition & 1 deletion django_extensions/management/commands/sqldiff.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
"""
sqldiff.py - Prints the (approximated) difference between models and database

2 changes: 1 addition & 1 deletion django_extensions/management/commands/sync_s3.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
"""
Sync Media to S3
================
2 changes: 1 addition & 1 deletion django_extensions/management/commands/syncdata.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
"""
SyncData
========
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
import os
from collections import defaultdict

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
from django.apps import apps as django_apps
from django.contrib.auth.management import create_permissions
from django.core.management.base import BaseCommand
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
import os

from django.core.management.base import BaseCommand, CommandError
2 changes: 1 addition & 1 deletion django_extensions/management/email_notifications.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding=utf-8
# -*- coding: utf-8 -*-
import sys
import traceback

Loading
Oops, something went wrong.

0 comments on commit 365e7cf

Please sign in to comment.