[openstack-dev] [bashate] .bashateignore

Sean Dague sean at dague.net
Fri Aug 29 14:02:16 UTC 2014

On 08/29/2014 08:53 AM, Dean Troyer wrote:
> On Fri, Aug 29, 2014 at 7:42 AM, Sean Dague <sean at dague.net
> <mailto:sean at dague.net>> wrote:
>     Integrating bashate into something as complicated as devstack, the file
>     ignore problem has come up.
>     We seem to have 3 approaches out under review right now:
>     https://review.openstack.org/#/c/117425 : --exclude-dirs
>     https://review.openstack.org/#/c/115794 : --exclude-dirs (different
>     implementation)
>     https://review.openstack.org/#/c/113892 : removing hidden directories
>     I'm actually kind of convinced now that none of these approaches are
>     what we need, and that we should instead have a .bashateignore file in
>     the root dir for the project instead, which would be regex that would
>     match files or directories to throw out of the walk.
>     I think that would handle the concerns that everyone is having, and
>     hopefully provides a more clear set of semantics in integrating.
>     Anyone up for taking a stab at this patch?
> I started the other night and ran into the usual semantic problems wrt
> meaning...rather than re-invent this wheel I found the pathspec module
> another new dependency!) that purports to do .gitignore-style handling,
> only it doesn't.  It's closer to  rsync include file syntax.  I managed
> to get it really close only to fail on handling bare directories
> properly.  Example:
> Ignoring a doc directory in .gitignore:
> doc
> Ignoring a doc directory in my trial:
> doc/
> It occurs to me that fixing this too means maybe I started down the
> wrong path.  This matters to be because I want to also leverage the
> existing .gitignore files we have.
> Just to join the party I pushed up the working state
> in https://review.openstack.org/117772.

If pathspec did the right thing, pulling in the extra dep would be fine,
but it doesn't seem like it does.

What if we just used 'glob' instead, find all the glob patterns and
intersect them out? I think there is a little bit of trickiness around
directories, but as glob.glob('topleveldir') matches it, I think that
intersection probably would work out fine as well.


Sean Dague

More information about the OpenStack-dev mailing list