all repos — elgit @ b51ef07d24db92f9c8a6f383f5e76a483adae458

fork of legit: web frontend for git, written in go

enable formatting via golangci-lint

Alan Pearce
commit

b51ef07d24db92f9c8a6f383f5e76a483adae458

parent

3bb944b8b1e79781346e71fe25e79bbc949b050a

M .golangci.yaml.golangci.yaml
@@ -57,6 +57,18 @@ - third_party$
- builtin$ - examples$ formatters: + enable: + - gofumpt + - golines + - goimports + settings: + gofmt: + simplify: true + golines: + tab-len: 2 + goimports: + local-prefixes: + - alin.ovh/searchix exclusions: generated: lax paths:
M git/git.gogit/git.go
@@ -352,7 +352,6 @@ }
_, err = io.Copy(tw, reader) err = errors.Join(err, reader.Close()) - if err != nil { return err }
M routes/handler.goroutes/handler.go
@@ -16,8 +16,10 @@
"alin.ovh/elgit/config" ) -var ErrMethodNotAllowed = fmt.Errorf("that's not possible") -var ErrNotFound = fmt.Errorf("nothing like that here") +var ( + ErrMethodNotAllowed = fmt.Errorf("that's not possible") + ErrNotFound = fmt.Errorf("nothing like that here") +) func Handlers(c *config.Config, staticFiles fs.FS) *atreugo.Atreugo { d := deps{
M routes/routes.goroutes/routes.go
@@ -26,8 +26,6 @@ repos *data.Entries
} func (d *deps) Index(rc *atreugo.RequestCtx) error { - - pageData := templates.PageData{ Meta: d.c.Meta, }
M templates/file.gotemplates/file.go
@@ -31,7 +31,8 @@ A(
ID(fmt.Sprintf("L%d", line)), Href(fmt.Sprintf("#L%d", line)), g.Text(fmt.Sprintf("%d", line)), - )}) + ), + }) })), ), Td(Class("file-content"),
M templates/index.gotemplates/index.go
@@ -3,11 +3,11 @@
import ( "time" - "github.com/dustin/go-humanize" "alin.ovh/elgit/data" g "alin.ovh/gomponents" c "alin.ovh/gomponents/components" . "alin.ovh/gomponents/html" + "github.com/dustin/go-humanize" ) func IndexPage(pd PageData, entries *data.Entries) g.Node {
M templates/refs.gotemplates/refs.go
@@ -3,10 +3,10 @@
import ( "fmt" - "github.com/go-git/go-git/v5/plumbing" "alin.ovh/elgit/git" g "alin.ovh/gomponents" . "alin.ovh/gomponents/html" + "github.com/go-git/go-git/v5/plumbing" ) // RefsPage renders the repository references page
M templates/tree.gotemplates/tree.go
@@ -74,5 +74,6 @@ ),
Article( g.If(readme != "", Pre(g.Raw(readme))), ), - )}) + ), + }) }
M unveil.gounveil.go
@@ -4,8 +4,9 @@
package main import ( + "log" + "golang.org/x/sys/unix" - "log" ) func Unveil(path string, perms string) error {