scripts/regression-hotspots.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
New commits: commit 1e0969a8c1ac9c0cb0a1b30f3de73a11583f20d9 Author: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org> AuthorDate: Fri Apr 12 10:11:14 2024 +0300 Commit: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org> CommitDate: Fri Apr 12 09:13:30 2024 +0200 regression-hotspots: improve output, exclusions, comments and names Change-Id: If548e67b7f39b24ccfc78c5d76d18f8fdc90fd80 Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/166021 Tested-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org> diff --git a/scripts/regression-hotspots.py b/scripts/regression-hotspots.py index 8a4fb76d..27a684fe 100755 --- a/scripts/regression-hotspots.py +++ b/scripts/regression-hotspots.py @@ -8,7 +8,7 @@ # # Uses https://github.com/gitpython-developers/GitPython # Results published in https://wiki.documentfoundation.org/Development/RegressionHotspots -# Run in LibreOffice core directory. Shouldn't take more than a minute. +# Run in LibreOffice core directory directing output to a text file. Shouldn't take more than a minute. import sys import re @@ -49,16 +49,20 @@ def get_dir_counts(file_counts, level): def print_counts(counts): printorder = reversed(sorted((count, name) for (name, count) in counts.items())) + # wiki page uses a widget to clamp the output while offering a button to expand + print('<pre class="clamped">') for count in printorder: print('%5d %s' % (count[0], count[1])) + print('</pre>') if __name__ == '__main__': file_counts = {} - excluderegex = re.compile(r'qa/|icon-themes/|extras/source/gallery/|extras/source/palettes/|extras/source/templates/|extras/source/truetype/|helpcontent2|dictionaries|translations|download\.lst|\.png|\.patch') + excluderegex = re.compile(r'qa/|qadevOOo/|icon-themes/|extras/source/gallery/|extras/source/palettes/|extras/source/templates/|extras/source/truetype/|\.git-hooks|helpcontent2|dictionaries|translations|download\.lst|\.png|\.patch') fixed_regression_ids = get_fixed_regression_bugs() sys.stderr.write('found %d fixed regressions: %s ' % (len(fixed_regression_ids), fixed_regression_ids)) # build a dictionary of hashes and bug IDs from all commits targeting a report in FDO/TDF Bugzilla + # (first commit with fdo# aka freedesktop.org is from 1 Oct 2010) gitbugs = {} buglog = git.Git('.').execute(['git', 'log', '--grep=(fdo|tdf)#', '-E', '--oneline', '--since=1.10.2010']) if buglog: @@ -70,10 +74,10 @@ if __name__ == '__main__': if bugid: gitbugs[githash] = int(bugid.group(1)) - # filter by the bug IDs we got from the Bugzilla query - regression_hashes = [key for key, value in gitbugs.items() if value in fixed_regression_ids] + # create a list of bug fix hashes by filtering with the bug IDs we got from the Bugzilla query + fix_hashes = [key for key, value in gitbugs.items() if value in fixed_regression_ids] - for githash in regression_hashes: + for githash in fix_hashes: lognames = git.Git('.').execute(['git', 'show', githash, '--pretty=tformat:', '--name-only']) if lognames: for filename in lognames.split(' '):