From 8f47ce0208e8d671a3c13ae4c0702d839e36c576 Mon Sep 17 00:00:00 2001 From: Andreas <andreasv@fsmpi.rwth-aachen.de> Date: Fri, 2 Aug 2019 22:09:44 +0200 Subject: [PATCH] fix some linter errors --- .gitlab-ci.yml | 2 +- sorter.py | 2 +- stats.py | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b26e75b..1ac5e81 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,7 +7,7 @@ linter: - python3 -V - uname -a - apt install -y sqlite3 locales-all git python3-flask python3-ldap3 python3-requests python3-lxml python3-icalendar python3-mysql.connector python3-requests python3-coverage pylint3 - - pylint3 --indent-string='\t' --indent-after-paren=1 --max-line-length=160 --docstring-min-length=9999 --output-format=text *.py | tee pylint.txt + - pylint3 --indent-string='\t' --indent-after-paren=1 --max-line-length=160 --disable=missing-docstring,unused-wildcard-import --output-format=text *.py | tee pylint.txt artifacts: paths: - pylint.txt diff --git a/sorter.py b/sorter.py index 7d2f72c..3da37e4 100644 --- a/sorter.py +++ b/sorter.py @@ -152,7 +152,7 @@ def sort_file(filename, course=None, lectures=None): matches = filter_lectures_by_datetime(lectures, data.get('date'), data.get('time')) # if we can't match exactly based on date and time, we have to match keywords if ((len(matches) != 1) and (len(data['keywords']) > 0)): - if not len(matches) == 0: + if not matches: # only test lectures with the correct date/time, if we have any matches = filter_lectures_by_keywords(matches, data['keywords']) else: diff --git a/stats.py b/stats.py index 6e9df8f..cc19aae 100644 --- a/stats.py +++ b/stats.py @@ -12,12 +12,12 @@ def stats(): for s in semester: year = int(s['semester'][0:4]) if s['semester'].endswith('ss'): - s['from'] = datetime(year,4,1) - s['to'] = datetime(year,10,1) + s['from'] = datetime(year, 4, 1) + s['to'] = datetime(year, 10, 1) if s['semester'].endswith('ws'): - s['from'] = datetime(year,10,1) - s['to'] = datetime(year+1,4,1) - return render_template('stats.html',semester=semester,filter=request.args.get('filter')) + s['from'] = datetime(year, 10, 1) + s['to'] = datetime(year+1, 4, 1) + return render_template('stats.html', semester=semester, filter=request.args.get('filter')) statsqueries = {} statsqueries['formats_views'] = "SELECT formats.description AS labels, count(DISTINCT log.id) AS `values` FROM log JOIN videos ON (videos.id = log.video) JOIN formats ON (formats.id = videos.video_format) GROUP BY formats.id" -- GitLab