Skip to content

Commit 36386df

Browse files
fix
1 parent 5216d92 commit 36386df

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

openapi/linter/converter/codegen_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,5 +398,7 @@ func assertGoldenFile(t *testing.T, filename, actual string) {
398398
expected, err := os.ReadFile(goldenPath)
399399
require.NoError(t, err, "should read golden file %s", filename)
400400

401-
assert.Equal(t, string(expected), actual, "output should match golden file %s", filename)
401+
// Normalize line endings for cross-platform compatibility (Windows checks out CRLF)
402+
normalizedExpected := strings.ReplaceAll(string(expected), "\r\n", "\n")
403+
assert.Equal(t, normalizedExpected, actual, "output should match golden file %s", filename)
402404
}

openapi/linter/converter/generate.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package converter
33
import (
44
"fmt"
55
"os"
6+
"path"
67
"path/filepath"
78
"sort"
89

@@ -140,7 +141,7 @@ func Generate(ir *IntermediateConfig, opts ...GenerateOption) (*GenerateResult,
140141
// 4. Add custom_rules config if we generated any rules
141142
if len(result.GeneratedRules) > 0 {
142143
result.Config.CustomRules = &linter.CustomRulesConfig{
143-
Paths: []string{filepath.Join(options.RulesDir, "*.ts")},
144+
Paths: []string{path.Join(options.RulesDir, "*.ts")},
144145
}
145146
}
146147

0 commit comments

Comments
 (0)