Skip to content

Commit 6230d55

Browse files
authored
chore: Remove line numbers from auto-gen typescript (#3258)
* chore: Remove line numbers from auto-gen typescript The line numbers are just extra noise that change when things shift around. They are not required and usually make CI fail when you forget to run 'make gen'.
1 parent 27ea415 commit 6230d55

File tree

2 files changed

+78
-82
lines changed

2 files changed

+78
-82
lines changed

scripts/apitypings/main.go

+1-5
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,7 @@ func (g *Generator) generateAll() (*TypescriptTypes, error) {
248248

249249
func (g *Generator) posLine(obj types.Object) string {
250250
file := g.pkg.Fset.File(obj.Pos())
251-
position := file.Position(obj.Pos())
252-
position.Filename = filepath.Join("codersdk", filepath.Base(position.Filename))
253-
return fmt.Sprintf("// From %s\n",
254-
position.String(),
255-
)
251+
return fmt.Sprintf("// From %s\n", filepath.Join("codersdk", filepath.Base(file.Name())))
256252
}
257253

258254
// buildStruct just prints the typescript def for a type.

0 commit comments

Comments
 (0)