From 6c3cf0dddce7c44323ae24a67cc815f96ea9b2ab Mon Sep 17 00:00:00 2001 From: Ben Boyter Date: Wed, 15 May 2024 16:12:56 +1000 Subject: [PATCH] Resolve issue 457 --- SCC-OUTPUT-REPORT.html | 38 +++++++++++++++++++------------------- processor/processor.go | 11 +++++++++++ test-all.sh | 10 ++++++++++ 3 files changed, 40 insertions(+), 19 deletions(-) diff --git a/SCC-OUTPUT-REPORT.html b/SCC-OUTPUT-REPORT.html index 24e901bee..8f1c2bb02 100644 --- a/SCC-OUTPUT-REPORT.html +++ b/SCC-OUTPUT-REPORT.html @@ -13,13 +13,13 @@ Go 30 - 9384 - 1462 + 9395 + 1463 454 - 7468 - 1520 - 403311 - 3958 + 7478 + 1524 + 403651 + 3963 processor/workers_test.go @@ -63,13 +63,13 @@ processor/processor.go - 644 - 137 + 655 + 138 101 - 406 - 87 - 18618 - 421 + 416 + 91 + 18958 + 427 processor/detector_test.go @@ -324,15 +324,15 @@ Total 30 - 9384 - 1462 + 9395 + 1463 454 - 7468 - 1520 - 403311 - 3958 + 7478 + 1524 + 403651 + 3963 - Estimated Cost to Develop (organic) $223,079
Estimated Schedule Effort (organic) 7.78 months
Estimated People Required (organic) 2.55
+ Estimated Cost to Develop (organic) $223,393
Estimated Schedule Effort (organic) 7.78 months
Estimated People Required (organic) 2.55
\ No newline at end of file diff --git a/processor/processor.go b/processor/processor.go index 66a2c9eaa..b4c294ac6 100644 --- a/processor/processor.go +++ b/processor/processor.go @@ -7,6 +7,7 @@ import ( "fmt" "os" "path/filepath" + "regexp" "runtime" "runtime/debug" "sort" @@ -596,6 +597,16 @@ func Process() { fileWalker.IncludeHidden = true fileWalker.ExcludeDirectory = PathDenyList + for _, exclude := range Exclude { + regexpResult, err := regexp.Compile(exclude) + if err == nil { + fileWalker.ExcludeFilenameRegex = append(fileWalker.ExcludeFilenameRegex, regexpResult) + fileWalker.ExcludeDirectoryRegex = append(fileWalker.ExcludeDirectoryRegex, regexpResult) + } else { + printError(err.Error()) + } + } + go func() { err := fileWalker.Start() if err != nil { diff --git a/test-all.sh b/test-all.sh index 287161d1a..37f72e4c9 100755 --- a/test-all.sh +++ b/test-all.sh @@ -885,6 +885,16 @@ else echo -e "${GREEN}PASSED exclude-ext check" fi +# Issue 457 +if ./scc -M ".*" | grep -q "0.000 megabytes"; then + echo -e "${GREEN}PASSED issue 457" +else + echo -e "${RED}=======================================================" + echo -e "FAILED issue 457" + echo -e "=======================================================${NC}" + exit +fi + # Try out specific languages for i in 'Bosque ' 'Flow9 ' 'Bitbucket Pipeline ' 'Docker ignore ' 'Q# ' 'Futhark ' 'Alloy ' 'Wren ' 'Monkey C ' 'Alchemist ' 'Luna ' 'ignore ' 'XML Schema ' 'Web Services' 'Go ' 'Java ' 'Boo ' 'License ' 'BASH ' 'C Shell ' 'Korn Shell ' 'Makefile ' 'Shell ' 'Zsh ' 'Rakefile ' 'Gemfile ' 'Dockerfile ' 'Yarn ' 'Sieve ' 'F# ' 'Elm ' 'Terraform ' 'Clojure ' 'C# ' 'LLVM IR ' 'HAML ' 'FXML ' 'DM ' 'Nushell ' 'Racket ' 'DOT ' 'YAML ' 'Teal ' 'FSL ' 'INI ' 'Hare ' 'Templ ' 'Cuda ' 'GraphQL ' 'Bicep ' 'Pkl ' 'TypeSpec ' 'LALRPOP ' 'Snakemake ' 'OpenQASM ' 'Typst ' 'ZoKrates ' 'Chapel ' 'Slang ' 'Circom ' do