add flake8 and setup.cfg for linting

some changes to pass flake8 linting. added setup.cfg for flake8
configuration. Ignoring E265 can be added to this file because
config/settings.py is flooded with this error. After #105 gets
merged it'll be OK.
This commit is contained in:
Sławek Ehlert 2014-08-07 21:10:26 +02:00
parent 3719db26de
commit 10e3e8f6ab
7 changed files with 16 additions and 14 deletions

View File

@ -1,3 +1,4 @@
# Test dependencies go here.
-r base.txt
coverage==3.7.1
flake8==2.2.2

View File

@ -0,0 +1,4 @@
[flake8]
#ignore = E265
max-line-length = 120
exclude = .tox,.git,*/migrations/*,*/static/CACHE/*,docs

View File

@ -23,7 +23,7 @@ setup(
],
include_package_data=True,
install_requires=[
'Django>=1.6.1',
'Django>=1.6.5',
],
zip_safe=False,
scripts=['{{ cookiecutter.repo_name }}/manage.py'],

View File

@ -173,9 +173,9 @@ class Common(Configuration):
)
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)
# See: http://django-crispy-forms.readthedocs.org/en/latest/install.html#template-packs
CRISPY_TEMPLATE_PACK = 'bootstrap3'
@ -270,7 +270,6 @@ class Common(Configuration):
}
########## END LOGGING CONFIGURATION
########## Your common stuff: Below this line define 3rd party libary settings
@ -364,7 +363,7 @@ class Production(Common):
AWS_EXPIREY = 60 * 60 * 24 * 7
AWS_HEADERS = {
'Cache-Control': 'max-age=%d, s-maxage=%d, must-revalidate' % (AWS_EXPIREY,
AWS_EXPIREY)
AWS_EXPIREY)
}
# See: https://docs.djangoproject.com/en/dev/ref/settings/#static-url
@ -373,7 +372,7 @@ class Production(Common):
########## EMAIL
DEFAULT_FROM_EMAIL = values.Value(
'{{cookiecutter.project_name}} <noreply@{{cookiecutter.domain_name}}>')
'{{cookiecutter.project_name}} <noreply@{{cookiecutter.domain_name}}>')
EMAIL_HOST = values.Value('smtp.sendgrid.com')
EMAIL_HOST_PASSWORD = values.SecretValue(environ_prefix="", environ_name="SENDGRID_PASSWORD")
EMAIL_HOST_USER = values.SecretValue(environ_prefix="", environ_name="SENDGRID_USERNAME")
@ -405,4 +404,3 @@ class Production(Common):
########## END CACHING
########## Your production stuff: Below this line define 3rd party libary settings

View File

@ -11,7 +11,7 @@ from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$',
url(r'^$', # noqa
TemplateView.as_view(template_name='pages/home.html'),
name="home"),
url(r'^about/$',
@ -31,4 +31,3 @@ urlpatterns = patterns('',
# Your stuff: custom urls go here
) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

View File

@ -4,7 +4,7 @@ from django.conf.urls import patterns, url
from users import views
urlpatterns = patterns('',
# URL pattern for the UserListView
# URL pattern for the UserListView # noqa
url(
regex=r'^$',
view=views.UserListView.as_view(),
@ -28,4 +28,4 @@ urlpatterns = patterns('',
view=views.UserUpdateView.as_view(),
name='update'
),
)
)

View File

@ -30,7 +30,7 @@ class UserRedirectView(LoginRequiredMixin, RedirectView):
def get_redirect_url(self):
return reverse("users:detail",
kwargs={"username": self.request.user.username})
kwargs={"username": self.request.user.username})
class UserUpdateView(LoginRequiredMixin, UpdateView):
@ -43,7 +43,7 @@ class UserUpdateView(LoginRequiredMixin, UpdateView):
# send the user back to their own page after a successful update
def get_success_url(self):
return reverse("users:detail",
kwargs={"username": self.request.user.username})
kwargs={"username": self.request.user.username})
def get_object(self):
# Only get the User record for the user making the request