tophat / codewatch

[deprecated] Monitor and manage deeply customizable metrics about your python code using ASTs
https://codewatch.io
Apache License 2.0
38 stars 3 forks source link

fix: use full relative path for dir filter and only traverse match #94

Closed noahnu closed 5 years ago

noahnu commented 5 years ago

Addresses: https://github.com/tophat/codewatch/issues/77

Two changes, both breaking changes:

One of the issues with the old behaviour:

Tests

Updated test_it_filters_on_directories to be stronger. It now tests using the full relative path "./dir2" rather than just a substring match. Since dir2_subdir will not match "./dir2", the test must be passing b/c the directory walker is successfully pruning the dir2 folder. Had to update the mock walker to actually work like the real os walk function (i.e. rely on a mutable directory list).

codecov[bot] commented 5 years ago

Codecov Report

Merging #94 into master will decrease coverage by 0.04%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #94      +/-   ##
==========================================
- Coverage   93.48%   93.43%   -0.05%     
==========================================
  Files          10       10              
  Lines         399      396       -3     
  Branches       57       57              
==========================================
- Hits          373      370       -3     
  Misses         15       15              
  Partials       11       11
Flag Coverage Δ
#py27 93.43% <100%> (-0.05%) :arrow_down:
#py36 93.43% <100%> (-0.05%) :arrow_down:
#py37 93.43% <100%> (-0.05%) :arrow_down:
Impacted Files Coverage Δ
codewatch/file_walker.py 100% <100%> (ø) :arrow_up:

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 6aef223...c79a215. Read the comment docs.

noahnu commented 5 years ago

Updated directory filter test and mock walker.