Skip to content

Commit

Permalink
add golangci-lint workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoisaiah committed Oct 5, 2024
1 parent d6b0972 commit 924a7b7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
23 changes: 23 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Lint code
on:
push:
branches:
- master
pull_request:

permissions:
contents: read

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.23
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.60
3 changes: 2 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ linters:
- decorder
- containedctx
- contextcheck
- copyloopvar
- dogsled
- dupl
- errcheck
- errchkjson
- errname
- errorlint
- exportloopref
- exhaustive
- goconst
- godot
Expand Down Expand Up @@ -47,6 +47,7 @@ linters:
- usestdlibvars
- unparam
- unused
- wastedassign
- whitespace
- wsl

Expand Down
4 changes: 4 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ build-win:
lint:
@golangci-lint run ./...

[no-cd]
lint-pkg:
@golangci-lint run ./...

pre-commit:
@pre-commit run

Expand Down

0 comments on commit 924a7b7

Please sign in to comment.