From 5bd1dc4bc93502467247f0461982720a988c3fc8 Mon Sep 17 00:00:00 2001 From: Henrique Holanda Date: Wed, 8 May 2024 17:55:41 -0300 Subject: [PATCH] ci: add lint pipeline --- .github/workflows/actions.yml | 5 +---- .github/workflows/golangci-lint.yml | 25 +++++++++++++++++++++++++ Makefile | 19 ------------------- go.sum | 0 4 files changed, 26 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/golangci-lint.yml create mode 100644 go.sum diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 4b35df8..3bf00b3 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -1,4 +1,4 @@ -name: Go Documents Pipeline +name: pipeline on: push: @@ -22,8 +22,5 @@ jobs: - name: Install dependencies run: make depend - - name: Run linter - run: make lint - - name: Run tests run: make test diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml new file mode 100644 index 0000000..09fdc89 --- /dev/null +++ b/.github/workflows/golangci-lint.yml @@ -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 \ No newline at end of file diff --git a/Makefile b/Makefile index 9281e37..9ae9413 100644 --- a/Makefile +++ b/Makefile @@ -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 ./...) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..e69de29