marco-c / autowebcompat

Automatically detect web compatibility issues
Mozilla Public License 2.0
34 stars 41 forks source link

Add handling for edge cases where file may not exist or be empty #266

Closed aru31 closed 5 years ago

aru31 commented 5 years ago

This is a fix for #261 accounting for blank files with os.stat() and preventing errors from being thrown.

codecov-io commented 5 years ago

Codecov Report

Merging #266 into master will decrease coverage by 0.01%. The diff coverage is 62.5%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #266      +/-   ##
==========================================
- Coverage   15.83%   15.82%   -0.02%     
==========================================
  Files          13       13              
  Lines        1894     1896       +2     
  Branches      328      329       +1     
==========================================
  Hits          300      300              
- Misses       1592     1593       +1     
- Partials        2        3       +1
Impacted Files Coverage Δ
autowebcompat/utils.py 50.21% <62.5%> (-0.44%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a68f213...4ad4f56. Read the comment docs.

aru31 commented 5 years ago

@marco-c please review my PR

marco-c commented 5 years ago

Instead of returning an empty dict, let's throw a meaningful error when the file is empty.

marco-c commented 5 years ago

Closing in favor of https://github.com/marco-c/autowebcompat/pull/267.