Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
MANAGE=django-admin.py
SETTINGS=fortytwo_test_task.settings

test:
test: check_noqa
PYTHONPATH=`pwd` DJANGO_SETTINGS_MODULE=$(SETTINGS) $(MANAGE) test
flake8 --exclude '*migrations*' apps fortytwo_test_task
flake8 --exclude '*migrations*,fortytwo_test_task/settings/__init__.py' apps fortytwo_test_task

check_noqa:
bash check_noqa.sh

run:
PYTHONPATH=`pwd` DJANGO_SETTINGS_MODULE=$(SETTINGS) $(MANAGE) runserver
Expand Down
10 changes: 10 additions & 0 deletions check_noqa.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

fnd=$(grep -ri "\bnoqa\b" apps fortytwo_test_task)

if [[ $fnd ]]; then
echo "WARNING: noqa statements were found"
exit 1
else
exit 0
fi
1 change: 1 addition & 0 deletions fortytwo_test_task/settings/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from .common import *

try:
from .local import *
except ImportError:
Expand Down
2 changes: 1 addition & 1 deletion fortytwo_test_task/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"""

import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "fortytwo_test_task.settings")

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()