Skip to content

Commit

Permalink
ci: enable golangci-lint (#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
ccoVeille authored Dec 7, 2024
1 parent 5fd8139 commit af16957
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,19 @@ jobs:
exit 1
fi
golangci-lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'

- name: Generate embed file
run: go generate ./...

- name: Launch golangci-lint
uses: golangci/golangci-lint-action@v6
50 changes: 50 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
# Ref: https://golangci-lint.run/usage/configuration/
# Inspired by https://github.com/ccoVeille/golangci-lint-config-examples/
linters:
enable:
- revive
- gci
- thelper
- mirror
- usestdlibvars
- misspell
- dupword
- loggercheck
- fatcontext

linters-settings:
gci:
sections:
- standard
- default
- localmodule

revive:
rules:
- name: blank-imports
- name: context-as-argument
arguments:
- allowTypesBefore: "*testing.T"
- name: context-keys-type
- name: dot-imports
- name: empty-block
- name: error-naming
- name: error-return
- name: error-strings
- name: errorf
- name: increment-decrement
- name: indent-error-flow
- name: range
- name: receiver-naming
- name: redefines-builtin-id
- name: superfluous-else
- name: time-naming
- name: unexported-return
- name: unreachable-code
- name: unused-parameter
- name: var-declaration
- name: var-naming

misspell:
locale: US

0 comments on commit af16957

Please sign in to comment.