Skip to content

Commit

Permalink
fix(CI): add golangci-lint to dependencies (cosmos#10112) (cosmos#10172)
Browse files Browse the repository at this point in the history
* fix(CI): add golangci-lint to dependencies (cosmos#10112)

* fix(CI): add golangci-lint to dependencies

* update github workflow

* tidy go.mod

* add missing entries to go.mod

* update deps

* add missing run command

* remove golint and use revive instead

* fix workflow setup

* lint only changed files

* gofmt go tags

* update comments

* make lint-go

Co-authored-by: Marko <[email protected]>
Co-authored-by: Federico Kunze Küllmer <[email protected]>

* Update .golangci.yml

* Update .golangci.yml

* fix go.mod

Co-authored-by: Marko <[email protected]>
Co-authored-by: Federico Kunze Küllmer <[email protected]>
  • Loading branch information
3 people authored and JeancarloBarrios committed Sep 28, 2024
1 parent 6bb1878 commit f147026
Show file tree
Hide file tree
Showing 5 changed files with 1,438 additions and 377 deletions.
35 changes: 8 additions & 27 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,18 @@ jobs:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
- uses: actions/[email protected]
with:
go-version: "1.23"
check-latest: true
- uses: technote-space/[email protected]
go-version: 1.16
- uses: technote-space/get-diff-action@v5
id: git_diff
with:
PATTERNS: |
**/*.mk
Makefile
**/Makefile
.golangci.yml
- name: Get rocksdb version
run: ./.github/scripts/get-rocksdb-version.sh
- name: Fix permissions for cache
run: sudo chown $(whoami) /usr/local/lib /usr/local/include
- name: Restore rocksdb libraries cache
id: cache-rocksdb
uses: actions/cache/restore@v4
with:
path: |
/usr/local/lib/librocksdb.*
/usr/local/include/rocksdb
key: ${{ runner.os }}-rocksdb-${{ env.ROCKSDB_VERSION }}-amd64
- name: Install rocksdb deps
run: ./.github/scripts/install-rocksdb-deps.sh
- name: Install rocksdb
if: steps.cache-rocksdb.outputs.cache-hit != 'true'
run: ./.github/scripts/install-rocksdb.sh
- name: run linting (long)
**/**.go
go.mod
go.sum
- name: run go linters
run: make lint-go
if: env.GIT_DIFF
id: lint_long
run: |
Expand Down
6 changes: 4 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@ linters:
- gci
- goconst
- gocritic
- gofumpt
- gofmt
- goimports
- gosec
- gosimple
- govet
- ineffassign
- misspell
- nakedret
- nolintlint
- prealloc
- revive
- exportloopref
- staticcheck
- stylecheck
- thelper
Expand Down
Loading

0 comments on commit f147026

Please sign in to comment.