Skip to content

Commit a14c844

Browse files
changed how .git files are parsed (#118)
Signed-off-by: guilhermepaulozup <guilherme.paulo@zup.com.br>
1 parent a02a883 commit a14c844

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

engine.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package engine
1717
import (
1818
"context"
1919
"io/fs"
20+
"os"
2021
"path/filepath"
2122
"strings"
2223
"sync"
@@ -177,5 +178,5 @@ func (e *Engine) isInvalidExtension(path string) bool {
177178

178179
// isFileFromGitFolder check if a file is in a .git folder
179180
func (e *Engine) isFileFromGitFolder(path string) bool {
180-
return strings.Contains(path, ".git")
181+
return strings.Contains(path, ".git"+string(os.PathSeparator))
181182
}

engine_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func TestEngineRun(t *testing.T) {
5555
projectPath: filepath.Join("text", "examples"),
5656
extensions: []string{AcceptAnyExtension},
5757
rules: newRuleMock([]Finding{{}}, nil),
58-
expectedFindings: 225,
58+
expectedFindings: 237,
5959
err: false,
6060
},
6161
{

0 commit comments

Comments
 (0)