Skip to content

Commit

Permalink
changed how .git files are parsed (#118)
Browse files Browse the repository at this point in the history
Signed-off-by: guilhermepaulozup <[email protected]>
  • Loading branch information
guilhermepaulozup authored Jun 9, 2022
1 parent a02a883 commit a14c844
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package engine
import (
"context"
"io/fs"
"os"
"path/filepath"
"strings"
"sync"
Expand Down Expand Up @@ -177,5 +178,5 @@ func (e *Engine) isInvalidExtension(path string) bool {

// isFileFromGitFolder check if a file is in a .git folder
func (e *Engine) isFileFromGitFolder(path string) bool {
return strings.Contains(path, ".git")
return strings.Contains(path, ".git"+string(os.PathSeparator))
}
2 changes: 1 addition & 1 deletion engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func TestEngineRun(t *testing.T) {
projectPath: filepath.Join("text", "examples"),
extensions: []string{AcceptAnyExtension},
rules: newRuleMock([]Finding{{}}, nil),
expectedFindings: 225,
expectedFindings: 237,
err: false,
},
{
Expand Down

0 comments on commit a14c844

Please sign in to comment.