src-d / enry

A faster file programming language detector
https://blog.sourced.tech/post/enry/
Apache License 2.0
460 stars 51 forks source link

CLI: inconsistent path filtering #226

Open bzz opened 5 years ago

bzz commented 5 years ago

Steps to reproduce:

mkdir -p /tmp/linguist-django
cd /tmp/linguist-django
git clone --depth 1 https://github.com/django/django.git
cd -

./enry /tmp/linguist-django/django/
95.87%  Python
1.85%   JavaScript
1.65%   HTML
0.63%   CSS
0.01%   Shell
0.00%   Smarty
0.00%   Makefile

./enry /tmp/linguist-django/
95.30%  Python
1.83%   JavaScript
1.63%   HTML
0.62%   CSS
0.53%   Roff Manpage
0.04%   Makefile
0.04%   Batchfile
0.01%   Shell
0.00%   Smarty

The difference is in Roff Manpage and Batchfile both under docs/ subdir in Django not being skipped on the second run.

The reason is that current documentation path filtering condition logic is not triggered, as the relative path in second case has prefix and does not match the regexp.

bzz commented 5 years ago

Need to decide if that is expected from the user perspective.

For now, I tend to think that this is a bug.