Skip to content

Commit

Permalink
ci: add lint pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
henriqueholanda committed May 8, 2024
1 parent 802a41a commit 5bd1dc4
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 23 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Go Documents Pipeline
name: pipeline

on:
push:
Expand All @@ -22,8 +22,5 @@ jobs:
- name: Install dependencies
run: make depend

- name: Run linter
run: make lint

- name: Run tests
run: make test
25 changes: 25 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: golangci-lint
on:
push:
branches:
- main
- master
pull_request:

permissions:
contents: read
pull-requests: read

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
19 changes: 0 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,6 @@ fmt:
gofmt -s -w -l $(shell go list -f {{.Dir}} ./...)
.PHONY: fmt

# Run linters
lint:
@gometalinter.v2 \
--disable-all \
--exclude=vendor \
--deadline=180s \
--enable=gofmt \
--linter='errch:errcheck {path}:PATH:LINE:MESSAGE' \
--enable=errch \
--enable=vet \
--enable=gocyclo \
--cyclo-over=15 \
--enable=golint \
--min-confidence=0.85 \
--enable=ineffassign \
--enable=misspell \
./..
.PHONY: lint

# Run tests
test:
@go test -v -race -coverprofile=./coverage.text -covermode=atomic $(shell go list ./...)
Expand Down
Empty file added go.sum
Empty file.

0 comments on commit 5bd1dc4

Please sign in to comment.