Closed axetroy closed 6 years ago
If merged. So we can remove test file happily
I wanna to remove all testfile name with xxxx.test.js
and here is the patten
// Default pruned which match regular expression
var DefaultRegExp = []string{
`\.___jb_tmp___$`, // generate by JetBrains ide, to detect the file change
`\.test\.(j|t)sx?$`, // remove all test file
}
I I recommend to match file with regexp.
You can do more thing simply
for example: Remove Gulpfile.js https://github.com/tj/node-prune/blob/1e61e90add69e4c3136d7d5b082bb4fc45f275f6/prune.go#L19 https://github.com/tj/node-prune/blob/1e61e90add69e4c3136d7d5b082bb4fc45f275f6/prune.go#L21
There is no need to write it twice.
just need a patten (?i)Gulpfile.js$
The regular expression shoud be the last step to check the file should be delete or not.
I don't think we should worry about his performance.
Go's regexps are pretty slow, curious how much of an impact it'll make, but I haven't noticed many cases where we'd need regexps
Here is the default regExp