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'.
This commit is contained in:
Steven Masley
2022-07-27 21:36:15 +00:00
committed by GitHub
parent 27ea415b6c
commit 6230d5512e
2 changed files with 78 additions and 82 deletions
+1 -5
View File
@@ -248,11 +248,7 @@ func (g *Generator) generateAll() (*TypescriptTypes, error) {
func (g *Generator) posLine(obj types.Object) string {
file := g.pkg.Fset.File(obj.Pos())
position := file.Position(obj.Pos())
position.Filename = filepath.Join("codersdk", filepath.Base(position.Filename))
return fmt.Sprintf("// From %s\n",
position.String(),
)
return fmt.Sprintf("// From %s\n", filepath.Join("codersdk", filepath.Base(file.Name())))
}
// buildStruct just prints the typescript def for a type.