Skip to content

Commit

Permalink
Fix for #108
Browse files Browse the repository at this point in the history
  • Loading branch information
boyter committed Aug 28, 2019
1 parent 56d9cf1 commit 11fb61a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
17 changes: 16 additions & 1 deletion processor/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,22 @@ func newFileJob(path, name string) *FileJob {
}

if ok {
if len(WhiteListExtensions) != 0 {
ok = false
for _, x := range WhiteListExtensions {
if x == extension {
ok = true
}
}

if !ok {
if Verbose {
printWarn(fmt.Sprintf("skipping file as not whitelisted: %s", name))
}
return nil
}
}

for _, l := range language {
LoadLanguageFeature(l)
}
Expand All @@ -213,7 +229,6 @@ func newFileJob(path, name string) *FileJob {
}
} else if Verbose {
printWarn(fmt.Sprintf("skipping file unknown extension: %s", name))

}

return nil
Expand Down
9 changes: 9 additions & 0 deletions test-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,15 @@ else
echo -e "${GREEN}PASSED gitignore recursive filter"
fi

if ./scc "examples/language/" --include-ext go | grep -q "Java "; then
echo -e "${RED}======================================================="
echo -e "FAILED include-ext option"
echo -e "=======================================================${NC}"
exit
else
echo -e "${GREEN}PASSED include-ext option"
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 '
do
Expand Down

0 comments on commit 11fb61a

Please sign in to comment.