Commit 5e4d086af7

5e4d086af731f28762c5622bfb9c61e032206328

parent: 23159cdf3a

Verified · cmc ci/build: success ci/lint: failure ci/test: success

cmc <hello@cleberg.net> · 2026-09-11 02:23 UTC

Add gitbay CI: build, test, lint

Three jobs in .gitbay/ci.yml on the runner's default image. Lint pins
golangci-lint v2.13.2 through go run. The tree's five existing lint
findings are fixed here so the first lint build is green.

Closes #7

Layout: unified · split

.gitbay/ci.yml added +19
@@ -0,0 +1,19 @@
1# gitbay CI. One build per push per job; each step runs with `sh -c` and the
2# job stops at the first failure. The image is the runner's default, named
3# here so a bump is a deliberate change.
4jobs:
5 build:
6 image: localhost/gitbay-ci:2
7 steps:
8 - go build ./...
9 - go vet ./...
10 test:
11 image: localhost/gitbay-ci:2
12 steps:
13 - go test ./... -count=1 -race -timeout 10m
14 # Pinned, and run through `go run` so the image needs no linter of its own.
15 # The first run on a runner compiles it; later runs hit the module cache.
16 lint:
17 image: localhost/gitbay-ci:2
18 steps:
19 - go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.13.2 run ./...
app/i18n.go +1 −1
@@ -87,7 +87,7 @@ func ResolveLang(acceptLanguage string) string {
8787 return DefaultLang
8888 }
8989
90 for _, part := range strings.Split(acceptLanguage, ",") {
90 for part := range strings.SplitSeq(acceptLanguage, ",") {
9191 tag := strings.TrimSpace(part)
9292 if i := strings.Index(tag, ";"); i >= 0 {
9393 tag = tag[:i]
app/i18n_test.go +1 −1
@@ -27,7 +27,7 @@ func TestEnglishCatalogueCoversEveryKeyTheTemplatesUse(t *testing.T) {
2727 }
2828
2929 for _, f := range files {
30 src, err := os.ReadFile(f)
30 src, err := os.ReadFile(f) //nolint:gosec // G304: the test reads the repository's own template files
3131 if err != nil {
3232 t.Fatalf("read %s: %v", f, err)
3333 }
app/parsers.go +3 −3
@@ -79,9 +79,6 @@ func (s skunkyart) ParseComments(c devianter.Comments, daError devianter.Error)
7979 return cmmts.String()
8080}
8181
82// DeviationList renders devs as an HTML grid, or as an Atom feed when the
83// request asked for one and allowAtom permits it. NSFW entries are dropped
84// unless the instance allows them. Passing content adds a navigation bar.
8582// VisibleDeviation reports whether a deviation may be shown by this instance.
8683//
8784// Both the HTML listing and the JSON API ask this, deliberately: an API that
@@ -95,6 +92,9 @@ func VisibleDeviation(d *devianter.Deviation) bool {
9592 return !d.NSFW || CFG.Nsfw
9693}
9794
95// DeviationList renders devs as an HTML grid, or as an Atom feed when the
96// request asked for one and allowAtom permits it. NSFW entries are dropped
97// unless the instance allows them. Passing content adds a navigation bar.
9898func (s skunkyart) DeviationList(devs []devianter.Deviation, allowAtom bool, content ...DeviationList) string {
9999 if s.Atom && s.Page > 1 {
100100 s.ReturnHTTPError(400)
app/util.go +1 −4
@@ -393,10 +393,7 @@ func (s skunkyart) NavBase(c DeviationList) string {
393393 // i reached 1, so page one rendered no numbers at all. With nothing before it
394394 // to link back to and no further page to link on, the whole panel came out as
395395 // a bare <br>.
396 last := c.Pages
397 if p > last {
398 last = p
399 }
396 last := max(c.Pages, p)
400397
401398 for i, x := p-6, 0; (i <= last && i <= p+6) && x < 12; i++ {
402399 if i > 0 {