Problem
Currently, the source package code formatting convention is not enforceable.
Proposed Solution
The datapages fmt command should be a superset of go fmt and should format the source package according to Datapages convention.
Input parameter order
func (PageFoo) GET(
sessionToken string,
session Session,
r *http.Request,
) {
to
func (PageFoo) GET(
r *http.Request,
session Session,
sessionToken string,
) {
func (PageIndex) OnEventX(
session Session,
sse *datastar.ServerSentEventGenerator,
event EventX,
) {
to
func (PageIndex) OnEventX(
event EventX,
sse *datastar.ServerSentEventGenerator,
session Session,
) {
Spaces/tabs in comments
// EventFoo is "asd"
type EventFoo struct {
Bar int `json:"bar"`
}
to
// EventFoo is "asd"
type EventFoo struct {
Bar int `json:"bar"`
}
// PageFoo is /foo
type EventFoo struct { App *App }
to
// EventFoo is /foo
type EventFoo struct { App *App }
Empty line between event head and arbitrary description.
// EventFoo is "asd"
// asdasd
type EventFoo struct {
Bar int `json:"bar"`
}
to
// EventFoo is "asd"
//
// asdasd
type EventFoo struct {
Bar int `json:"bar"`
}
Alternatives Considered
No response
Problem
Currently, the source package code formatting convention is not enforceable.
Proposed Solution
The
datapages fmtcommand should be a superset ofgo fmtand should format the source package according to Datapages convention.Input parameter order
to
to
Spaces/tabs in comments
to
to
Empty line between event head and arbitrary description.
to
Alternatives Considered
No response