boyter / scc

Sloc, Cloc and Code: scc is a very fast accurate code counter with complexity calculations and COCOMO estimates written in pure Go
MIT License
6.28k stars 250 forks source link

How can I include all _test.go files by regex. #392

Open myzhan opened 1 year ago

myzhan commented 1 year ago

I need to walk through all _test.go files and get the lines of test code.

myzhan commented 1 year ago

I try to use --remap-all to workaround.

scc -c --no-cocomo -i "go" --exclude-dir ".git,vendor" --remap-all "ginkgo":"Ginkgo test"
boyter commented 1 year ago

Actually looking though there is no good way to do this. You might be able to do so though negative lookups such as

scc -M "\(?\!test\)"

Or some such...

I am in the middle of porting scc to use https://github.com/boyter/gocodewalker/ to get proper .gitignore support and when I do so I can map through the include stuff.

Going to add that on the todo pile which will ensure this can be done more easily.