perf/compare-logs.py | 3 ++- qa/bugzillaDataAnalyzer.py | 3 +-- qa/createBlogReport.py | 8 +------- qa/createWeeklyReport.py | 2 -- qa/createWikiStats.py | 2 -- qa/document_analyser.py | 3 --- 6 files changed, 4 insertions(+), 17 deletions(-)
New commits: commit 51c4f0a5215da7bb5df60a380f7f588967813b3b Author: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org> AuthorDate: Thu Jul 18 17:58:16 2024 +0300 Commit: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org> CommitDate: Thu Jul 18 17:00:10 2024 +0200 perf, qa: fix issues found by Ruff linter Change-Id: I5acb07130a96d125396992361a5318d1309111b3 Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/170696 Tested-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org> diff --git a/perf/compare-logs.py b/perf/compare-logs.py index 90a60daa..b1375ae6 100755 --- a/perf/compare-logs.py +++ b/perf/compare-logs.py @@ -25,7 +25,8 @@ # in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable # instead of those above. -import sys, os +import sys +import os import argparse def readFile(url): diff --git a/qa/bugzillaDataAnalyzer.py b/qa/bugzillaDataAnalyzer.py index 1ff4be85..439fd359 100755 --- a/qa/bugzillaDataAnalyzer.py +++ b/qa/bugzillaDataAnalyzer.py @@ -336,7 +336,7 @@ def util_print_QA_line_data(statList, dValue, kind, action, total_count): usersString += statList['people'][i2]['name'] + ' ( ' + str(i1) + ' ) ' else: break - except: + except Exception: if i2 == 'UNKNOWN': continue usersString += i2 + ' ( ' + str(i1) + ' ) ' @@ -383,7 +383,6 @@ def util_print_QA_line_data(statList, dValue, kind, action, total_count): if 'difftime' in dValue and dValue['difftime']: sortList = sorted(dValue['difftime']) - rangeList = sortList[-1] - sortList[0] subLists = {} for i in sortList: timePeriod = '' diff --git a/qa/createBlogReport.py b/qa/createBlogReport.py index c8276938..111e36ee 100755 --- a/qa/createBlogReport.py +++ b/qa/createBlogReport.py @@ -11,7 +11,6 @@ import common import math from datetime import datetime, timedelta -import matplotlib import matplotlib.pyplot as plt lKeywords = ['havebacktrace', 'regression', 'bisected'] @@ -104,11 +103,6 @@ def analyze_bugzilla_data(statList, bugzillaData, cfg): unconfirmedCountPerDay[actionDay] = 0 unconfirmedCountPerDay[actionDay] += 1 - rowStatus = row['status'] - rowResolution = row['resolution'] - - rowKeywords = row['keywords'] - creatorMail = row['creator'] #get information about created bugs in the period of time @@ -514,7 +508,7 @@ def createPlot(valueDict, plotType, plotTitle, plotLabel, plotColor): plt.xticks(range(len(x)), x, rotation=90) plt.title(plotTitle) plt.xlabel("Date") - plt.legend(); + plt.legend() ax = plt.gca() ax.grid(axis="y", linestyle='--') #Remove labels depending on number of elements diff --git a/qa/createWeeklyReport.py b/qa/createWeeklyReport.py index b446f08d..0c36246d 100755 --- a/qa/createWeeklyReport.py +++ b/qa/createWeeklyReport.py @@ -67,8 +67,6 @@ def analyze_bugzilla_weeklyReport(statList, bugzillaData, cfg): rowKeywords = row['keywords'] - crashSignature = row['cf_crashreport'] - for action in row['history']: actionMail = action['who'] actionDate = datetime.datetime.strptime(action['when'], "%Y-%m-%dT%H:%M:%SZ") diff --git a/qa/createWikiStats.py b/qa/createWikiStats.py index c7550e35..b95c5098 100755 --- a/qa/createWikiStats.py +++ b/qa/createWikiStats.py @@ -181,7 +181,6 @@ def analyze_bugzilla_wiki_stats(statList, bugzillaData, cfg): if change['field_name'] == 'status': addedStatus = change['added'] - removedStatus = change['removed'] if addedStatus == 'RESOLVED' or addedStatus == 'VERIFIED': if(rowResolution): @@ -217,7 +216,6 @@ def analyze_bugzilla_wiki_stats(statList, bugzillaData, cfg): util_increase_user_actions(statList, key, actionMail, bugTargets, 'keyword_removed', actionDate) elif change['field_name'] == 'op_sys': - newSystem = change['added'] util_increase_user_actions(statList, rowId, actionMail, bugTargets, 'system_changed', actionDate) comments = row['comments'][1:] diff --git a/qa/document_analyser.py b/qa/document_analyser.py index c97ae597..17ffb743 100755 --- a/qa/document_analyser.py +++ b/qa/document_analyser.py @@ -21,9 +21,6 @@ syllable count, table count, textbox count, word count, and paragraph styles. import sys import os -import odf -from odf.namespaces import TEXTNS -from odf.element import Element from odf.opendocument import load from odf import text,meta,office,draw