Skip to content

Commit 8875dba

Browse files
committed
fix: Lint: PACKAGE_DIRECTORY_MATCH for windows paths
1 parent 17e9ae5 commit 8875dba

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

internal/rules/package_directory_match.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package rules
22

33
import (
4+
"log/slog"
45
"path/filepath"
56
"strings"
67

@@ -24,9 +25,11 @@ func (d *PackageDirectoryMatch) Validate(protoInfo core.ProtoInfo) ([]core.Issue
2425
var res []core.Issue
2526

2627
preparePath := filepath.Dir(strings.TrimPrefix(protoInfo.Path, d.Root))
28+
preparePath = filepath.ToSlash(preparePath)
2729
expectedPackage := strings.ReplaceAll(preparePath, "/", ".")
2830

2931
for _, pkgInfo := range protoInfo.Info.ProtoBody.Packages {
32+
slog.Info("data", "preparePath", preparePath, "expectedPackage", expectedPackage, "pkgInfo.Name", pkgInfo.Name)
3033
if pkgInfo.Name != expectedPackage {
3134
res = core.AppendIssue(res, d, pkgInfo.Meta.Pos, protoInfo.Path, pkgInfo.Comments)
3235
}

0 commit comments

Comments
 (0)