Make --include rules add their implict exclude * at the end of the filter list

This means you can mix `--include` and `--include-from` with the
other filters (eg `--exclude`) but you must include all the files you
want in the include statement.

Fixes #280
This commit is contained in:
Nick Craig-Wood 2016-01-10 11:42:53 +00:00
parent 01aa4394a6
commit af5f4ee724
3 changed files with 21 additions and 15 deletions

View file

@ -147,16 +147,15 @@ func TestNewFilterFull(t *testing.T) {
}
got := f.DumpFilters()
want := `+ (^|/)include1$
- (^|/)[^/]*$
+ (^|/)include2$
+ (^|/)include3$
- (^|/)[^/]*$
- (^|/)exclude1$
- (^|/)exclude2$
- (^|/)exclude3$
- (^|/)filter1$
+ (^|/)filter2$
- (^|/)filter3$`
- (^|/)filter3$
- (^|/)[^/]*$`
if got != want {
t.Errorf("rules want %s got %s", want, got)
}