tonybaloney / wily

A Python application for tracking, reporting on timing and complexity in Python code
Apache License 2.0
1.21k stars 59 forks source link

Avoid report erroring out if there is no data to show #203

Closed devdanzin closed 1 year ago

devdanzin commented 1 year ago

When running wily report --changes, it's possible to end up with no data to show, which results in an IndexError from tabulate. In this PR the same guard-clause strategy of #197 is used to avoid that, while logging an error explaining why no output is generated.

This fixes an error that surfaced in #201, but I can't see why it would be triggered by that change.

codecov-commenter commented 1 year ago

Codecov Report

Merging #203 (19e2b81) into master (578e361) will increase coverage by 0.01%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #203      +/-   ##
==========================================
+ Coverage   95.32%   95.33%   +0.01%     
==========================================
  Files          24       24              
  Lines        1241     1244       +3     
  Branches      278      279       +1     
==========================================
+ Hits         1183     1186       +3     
  Misses         33       33              
  Partials       25       25              
Files Changed Coverage Δ
src/wily/commands/report.py 97.16% <100.00%> (+0.08%) :arrow_up: