diff --git a/README.md b/README.md index 55dd2c297..c34fc8ad8 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ USAGE: scc DIRECTORY VERSION: - 1.6.0 + 1.7.0 COMMANDS: help, h Shows a list of commands or help for one command @@ -85,6 +85,7 @@ GLOBAL OPTIONS: --averagewage value, --aw value Set as integer to set the average wage used for basic COCOMO calculation (default: 56286) --cocomo, --co Set to check remove COCOMO calculation output --filegccount value, --fgc value How many files to parse before turning the GC on (default: 10000) + --binary Set to disable binary file detection --debug Set to enable debug output --trace Set to enable trace output, not recommended for multiple files --help, -h show help diff --git a/main.go b/main.go index c19749b13..49e312dd2 100644 --- a/main.go +++ b/main.go @@ -17,7 +17,7 @@ func main() { app := cli.NewApp() app.EnableBashCompletion = true app.Name = "scc" - app.Version = "1.6.0" + app.Version = "1.7.0" app.Usage = "Sloc, Cloc and Code. Count lines of code in a directory with complexity estimation." app.UsageText = "scc DIRECTORY" diff --git a/processor/file.go b/processor/file.go index a3f89dcab..4fb68c197 100644 --- a/processor/file.go +++ b/processor/file.go @@ -76,6 +76,7 @@ func walkDirectoryParallel(root string, output *chan *FileJob) { all, _ := ioutil.ReadDir(root) // TODO the gitignore should check for futher gitignores deeper in the tree gitignore, gitignoreerror := gitignore.NewGitIgnore(filepath.Join(root, ".gitignore")) + resetGc := false for _, f := range all { // Godirwalk despite being faster than the default walk is still too slow to feed the @@ -104,8 +105,9 @@ func walkDirectoryParallel(root string, output *chan *FileJob) { mutex.Unlock() // Turn GC back to what it was before if we have parsed enough files - if totalCount >= GcFileCount { + if !resetGc && totalCount >= GcFileCount { debug.SetGCPercent(gcPercent) + resetGc = true } wg.Done() }(filepath.Join(root, f.Name()))