Closed laulaz closed 7 years ago
Looks good for me. I find this especially useful when trying to exclude certain subdirectories (populated by gulp, webpack, etc.)
Can we merge this, @mauritsvanrees?
I thought I had reacted to this, but apparently not... Sorry about that!
I like the idea. And when I try it out, it works.
But I dislike having to use Python regular expressions on the command line. I did not realise how I needed to write it (of course I did not read the docs...) so it looked like it did not work.
How about using glob
instead?
For example, this is how that looks in the i18ndude top level folder:
>>> import glob
>>> glob.glob('*py')
['bootstrap.py', 'setup.py']
@mauritsvanrees: Thanks for the suggestion ! I tried to change to glob
today. But I figured out that then we cannot keep existing behavior easily.
Example : in many packages, we have
--exclude="rss_template.pt metadata_edit_form.cpt metadirectives.py Discussion_Item.xml event.py"
This cannot be use as is with glob
without changing or converting the expression.
I'm not feeling ready to make those changes ...
@laulaz Can you check my pull request #40 which I based on your changes. It uses fnmatch
instead of re
or glob
, as we were already using that module. It works fine for your use case as far as I can see.
@laulaz @pgrunewald If you have time to check if my pull request #40 works for your use case, that would be good.
It's perfectly fine for our use case.
I have merged my pull request #40 and made release 4.1.
This doesn't break existing behavior