Skip to content
Snippets Groups Projects
Commit 0acfd677 authored by robinwilliam.hundt's avatar robinwilliam.hundt
Browse files

Added local prospector pre-commit hook

also removed unused arguments in delber.py that prospector didn't like
parent cdbec165
No related branches found
No related tags found
2 merge requests!15Refactor,!14Pre commit
repos:
- repo: git://github.com/guykisel/prospector-mirror
sha: '' # Use the sha / tag you want to point at test
- repo: local
hooks:
- id: prospector
name: prospector
entry: prospector --uses django
language: system
types: [python]
\ No newline at end of file
......@@ -15,7 +15,6 @@ os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'grady.settings')
django.setup()
unused_variable = []
def parseme():
parser = argparse.ArgumentParser()
......@@ -84,7 +83,7 @@ def parseme():
return parser.parse_args()
def handle_passwordlist(output=sys.stdout, instance="", **kwargs):
def handle_passwordlist(output=sys.stdout, instance=""):
with open('/usr/share/dict/words') as words:
choose_from = list({word.strip().lower()
for word in words if 5 < len(word) < 8})
......@@ -102,7 +101,7 @@ def handle_passwordlist(output=sys.stdout, instance="", **kwargs):
student.user.username, password, instance])
def handle_enableusers(switch, exclude, include, **kwargs):
def handle_enableusers(switch, exclude, include):
if include:
for user in User.objects.filter(username__in=include):
......@@ -114,7 +113,7 @@ def handle_enableusers(switch, exclude, include, **kwargs):
user.save()
def handle_replaceusernames(matno2username_dict, **kwargs):
def handle_replaceusernames(matno2username_dict):
matno2username = json.JSONDecoder().decode(matno2username_dict.read())
for student in Student.objects.all():
if student.matrikel_no in matno2username:
......@@ -123,12 +122,12 @@ def handle_replaceusernames(matno2username_dict, **kwargs):
student.user.save()
def handle_extractsubmissions(output, **kwargs):
def handle_extractsubmissions():
for submission in Submission.objects.filter(feedback__isnull=False).order_by('type'):
print(submission.feedback.score, repr(submission.text), file=open(str(submission.type).replace(' ', '_'), 'a'))
def handle_importer(**kwargs):
def handle_importer():
util.importer.start()
def main():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment