Skip to content

Commit

Permalink
Enable golangci-lint and go test
Browse files Browse the repository at this point in the history
  • Loading branch information
mihaitodor committed Apr 6, 2022
1 parent 74e5143 commit d97d7bd
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: golangci-lint
on: [push, pull_request]
permissions:
contents: read
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.45.2
17 changes: 17 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: test
on: [push, pull_request]
permissions:
contents: read
jobs:
test:
strategy:
matrix:
go-version: [1.17.x, 1.18.x]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v3
- run: go test ./...
30 changes: 30 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
run:
timeout: 30s

issues:
max-issues-per-linter: 0
max-same-issues: 0

linters-settings:
depguard:
include-go-root: true
packages:
- "io/ioutil"

linters:
enable:
# Enable some extra linters
- gofmt
- goimports
- gocritic
- revive
# stylecheck warns about errors starting with a capital letter, which should be fixed in the next major release
# - stylecheck
- unconvert
- durationcheck
- wastedassign
- depguard
- bodyclose
- gosec
- misspell
- prealloc

0 comments on commit d97d7bd

Please sign in to comment.