From a72070e575659fc5891bc368170ac9f387451e20 Mon Sep 17 00:00:00 2001 From: Conrad Hoffmann Date: Tue, 4 Nov 2025 15:22:26 +0100 Subject: [PATCH] Run golangci-lint in CI See https://golangci-lint.run This has already helped uncover some issues, and we should make more use of it. Currently we have to disable one of the default lints, as we have a lot of issues it complains about. I plan to address those one by one and enable it. Until then, put this in place to make sure we don't re-introduce any of the issues we've eliminated so far. --- .builds/alpine.yml | 4 ++++ .golangci.yml | 5 +++++ 2 files changed, 9 insertions(+) create mode 100644 .golangci.yml diff --git a/.builds/alpine.yml b/.builds/alpine.yml index 90b2abd754cfb988222712d6259fd2d9907e9973..e839fc256f5b2af915211ea7620f31efbc682464 100644 --- a/.builds/alpine.yml +++ b/.builds/alpine.yml @@ -1,9 +1,13 @@ image: alpine/3.22 packages: - go + - golangci-lint sources: - https://git.sr.ht/~sircmpwn/core-go tasks: +- lint: | + cd core-go + golangci-lint run - build: | cd core-go go build ./... diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000000000000000000000000000000000000..5469fac956aada45f56c9ec7c6d9d9d1e8b32150 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,5 @@ +# TODO: handle all errcheck complaints and re-enable +version: 2 +linters: + disable: + - errcheck