From 1f1a3885e01caf1f9596a52a665a221480dca0e7 Mon Sep 17 00:00:00 2001 From: Bruno Carlin Date: Sat, 4 May 2024 01:31:43 +0200 Subject: [PATCH] support: add test workflow --- .forgejo/workflows/test.yml | 22 ++++++++++++++++++++++ .golangci.yml | 26 ++++++++++++-------------- 2 files changed, 34 insertions(+), 14 deletions(-) create mode 100644 .forgejo/workflows/test.yml diff --git a/.forgejo/workflows/test.yml b/.forgejo/workflows/test.yml new file mode 100644 index 0000000..04a2d95 --- /dev/null +++ b/.forgejo/workflows/test.yml @@ -0,0 +1,22 @@ +on: [push] +jobs: + linting: + runs-on: docker + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: stable + - uses: https://github.com/golangci/golangci-lint-action@v4 + tests: + runs-on: docker + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: stable + - name: Install dependencies + run: go get . + - name: Run tests + run: go test + diff --git a/.golangci.yml b/.golangci.yml index c90bbd8..0075818 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -324,16 +324,14 @@ linters-settings: # minimal confidence for issues, default is 0.8 min-confidence: 0.8 - gomnd: - settings: - mnd: - # the list of enabled checks, see https://github.com/tommy-muehle/go-mnd/#checks for description. - checks: argument,case,condition,operation,return,assign - # for files perm: 384=0o600 - ignored-numbers: 0o600,384,0o700,0o744 - # test files are ignored by default - # ignored-files: - # ignored-functions: math.* + mnd: + # the list of enabled checks, see https://github.com/tommy-muehle/go-mnd/#checks for description. + checks: argument,case,condition,operation,return,assign + # for files perm: 384=0o600 + ignored-numbers: 0o600,384,0o700,0o744 + # test files are ignored by default + # ignored-files: + # ignored-functions: math.* gomoddirectives: # Allow local `replace` directives. Default is false. @@ -395,9 +393,6 @@ linters-settings: checks: [ "all" ] govet: - # report about shadowed variables - check-shadowing: true - # settings per analyzer #settings: # printf: # analyzer name, run `go tool vet help` to see all analyzers @@ -411,7 +406,7 @@ linters-settings: # run `go tool vet help` to see all analyzers #enable: # - atomicalign - #enable-all: false + enable-all: false #disable: # - shadow #disable-all: false @@ -675,10 +670,13 @@ linters: disable: - depguard - dogsled + - execinquery # deprecated - exhaustivestruct + - exhaustruct - godox - goheader - golint + - gomnd # deprecated - interfacer - ireturn - maligned