Add comments containing source file to generated files

This commit is contained in:
Elara 2023-01-07 15:05:40 -08:00
parent 6f5a84c24b
commit 9788468c0a
37 changed files with 48 additions and 1 deletions

View File

@ -89,6 +89,11 @@ func main() {
} }
defer outFl.Close() defer outFl.Close()
_, err = outFl.WriteString("// Source: " + path + "\n")
if err != nil {
return err
}
return generator.NewStruct(outFl, "types").Generate(fileStructs) return generator.NewStruct(outFl, "types").Generate(fileStructs)
}) })
if err != nil { if err != nil {
@ -135,7 +140,8 @@ func main() {
} }
} }
rf, err := os.Open(filepath.Join(*lemmyDir, routesFile)) routesPath := filepath.Join(*lemmyDir, routesFile)
rf, err := os.Open(routesPath)
if err != nil { if err != nil {
panic(err) panic(err)
} }
@ -153,6 +159,11 @@ func main() {
} }
defer orf.Close() defer orf.Close()
_, err = orf.WriteString("// Source: " + routesPath + "\n")
if err != nil {
panic(err)
}
err = generator.NewRoutes(orf, "lemmy").Generate(routes, impls) err = generator.NewRoutes(orf, "lemmy").Generate(routes, impls)
if err != nil { if err != nil {
panic(err) panic(err)

View File

@ -1,3 +1,4 @@
// Source: lemmy/src/api_routes.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (routes generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (routes generator). DO NOT EDIT.
package lemmy package lemmy

View File

@ -1,3 +1,4 @@
// Source: lemmy/crates/db_schema/src/source/activity.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types package types

View File

@ -1,3 +1,4 @@
// Source: lemmy/crates/db_schema/src/source/comment.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types package types

View File

@ -1,3 +1,4 @@
// Source: lemmy/crates/api_common/src/comment.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types package types

View File

@ -1,3 +1,4 @@
// Source: lemmy/crates/db_schema/src/source/comment_report.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types package types

View File

@ -1,3 +1,4 @@
// Source: lemmy/crates/db_schema/src/source/community.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types package types

View File

@ -1,3 +1,4 @@
// Source: lemmy/crates/api_common/src/community.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types package types

View File

@ -1,3 +1,4 @@
// Source: lemmy/crates/db_schema/src/source/community_block.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types package types

View File

@ -1,3 +1,4 @@
// Source: lemmy/crates/db_schema/src/source/email_verification.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types package types

View File

@ -1,3 +1,4 @@
// Source: lemmy/crates/db_schema/src/lib.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types package types

View File

@ -1,3 +1,4 @@
// Source: lemmy/crates/websocket/src/lib.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types package types

View File

@ -1,3 +1,4 @@
// Source: lemmy/crates/api_common/src/lib.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types package types

View File

@ -1,3 +1,4 @@
// Source: lemmy/crates/db_schema/src/source/local_user.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types package types

View File

@ -1,3 +1,4 @@
// Source: lemmy/crates/db_schema/src/source/mod.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types package types

View File

@ -1,3 +1,4 @@
// Source: lemmy/crates/db_schema/src/source/moderator.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types package types

View File

@ -1,3 +1,4 @@
// Source: lemmy/crates/db_schema/src/source/password_reset_request.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types package types

View File

@ -1,3 +1,4 @@
// Source: lemmy/crates/db_schema/src/source/person.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types package types

View File

@ -1,3 +1,4 @@
// Source: lemmy/crates/api_common/src/person.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types package types

View File

@ -1,3 +1,4 @@
// Source: lemmy/crates/db_schema/src/source/person_block.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types package types

View File

@ -1,3 +1,4 @@
// Source: lemmy/crates/db_schema/src/source/person_mention.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types package types

View File

@ -1,3 +1,4 @@
// Source: lemmy/crates/db_schema/src/source/post.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types package types

View File

@ -1,3 +1,4 @@
// Source: lemmy/crates/api_common/src/post.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types package types

View File

@ -1,3 +1,4 @@
// Source: lemmy/crates/db_schema/src/source/post_report.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types package types

View File

@ -1,3 +1,4 @@
// Source: lemmy/crates/db_schema/src/source/private_message.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types package types

View File

@ -1,3 +1,4 @@
// Source: lemmy/crates/db_schema/src/source/registration_application.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types package types

View File

@ -1,3 +1,4 @@
// Source: lemmy/crates/api_common/src/request.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types package types

View File

@ -1,3 +1,4 @@
// Source: lemmy/crates/db_schema/src/source/secret.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types package types

View File

@ -1,3 +1,4 @@
// Source: lemmy/crates/api_common/src/sensitive.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types package types

View File

@ -1,3 +1,4 @@
// Source: lemmy/crates/db_schema/src/source/site.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types package types

View File

@ -1,3 +1,4 @@
// Source: lemmy/crates/api_common/src/site.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types package types

View File

@ -1,3 +1,4 @@
// Source: lemmy/crates/db_views/src/structs.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types package types

View File

@ -1,3 +1,4 @@
// Source: lemmy/crates/db_views_moderator/src/structs.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types package types

View File

@ -1,3 +1,4 @@
// Source: lemmy/crates/db_schema/src/aggregates/structs.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types package types

View File

@ -1,3 +1,4 @@
// Source: lemmy/crates/db_views_actor/src/structs.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types package types

View File

@ -1,3 +1,4 @@
// Source: lemmy/crates/api_common/src/utils.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types package types

View File

@ -1,3 +1,4 @@
// Source: lemmy/crates/api_common/src/websocket.rs
// Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT. // Code generated by go.arsenm.dev/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types package types