diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..9cc7b151 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,17 @@ +# `dependabot.yml` file with updates +# disabled for Docker and limited for npm + +version: 2 +updates: + - package-ecosystem: "gomod" + directory: "/" + schedule: + interval: "daily" + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + + + diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..ec8c5fec --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,15 @@ +on: [push, pull_request] +name: Test +jobs: + test: + strategy: + matrix: + go-version: [1.20.x, 1.21.x] + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + with: + go-version: ${{ matrix.go-version }} + - run: go build ./... diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml deleted file mode 100644 index f16837c3..00000000 --- a/.github/workflows/go.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: CI - -on: - push: - branches: [ $default-branch ] - pull_request: - -jobs: - - Build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: 1.18 - - - name: Build - run: make build - - Test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: 1.18 - - - name: Test - run: make test \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..cecd3a0e --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,15 @@ +on: [push, pull_request] +name: Test +jobs: + test: + strategy: + matrix: + go-version: [1.20.x, 1.21.x] + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + with: + go-version: ${{ matrix.go-version }} + - run: go test ./... diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 00000000..0c3f7535 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,129 @@ +run: + tests: true + timeout: 10m + +linters: + disable-all: true + enable: + - exportloopref + - errcheck + - gci + - goconst + - gocritic + - gofumpt + - gosec + - gosimple + - govet + - ineffassign + - misspell + - nakedret + - staticcheck + - thelper + - typecheck +# - stylecheck + - revive + - typecheck + - tenv + - unconvert + - unparam + - unused + - misspell + + +issues: + exclude-rules: + - text: 'differs only by capitalization to method' + linters: + - revive + - text: 'Use of weak random number generator' + linters: + - gosec + - linters: + - staticcheck + text: "SA1019:" # silence errors on usage of deprecated funcs + + max-issues-per-linter: 10000 + max-same-issues: 10000 + +linters-settings: + gci: + sections: + - standard # Standard section: captures all standard packages. + - default # Default section: contains all imports that could not be matched to another section type. + - blank # blank imports + - dot # dot imports + - prefix(cosmossdk.io) + - prefix(github.com/cosmos/cosmos-sdk) + - prefix(github.com/cometbft/cometbft) + - prefix(github.com/cosmos/ibc-go) + - prefix(github.com/CudoVentures/cudos-node) + custom-order: true + gocritic: + disabled-checks: + - appendAssign + + revive: + enable-all-rules: true + # Do NOT whine about the following, full explanation found in: + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#description-of-available-rules + rules: + - name: use-any + disabled: true + - name: if-return + disabled: true + - name: max-public-structs + disabled: true + - name: cognitive-complexity + disabled: true + - name: argument-limit + disabled: true + - name: cyclomatic + disabled: true + - name: file-header + disabled: true + - name: function-length + disabled: true + - name: function-result-limit + disabled: true + - name: line-length-limit + disabled: true + - name: flag-parameter + disabled: true + - name: import-shadowing + disabled: true + - name: add-constant + disabled: true + - name: empty-lines + disabled: true + - name: banned-characters + disabled: true + - name: deep-exit + disabled: true + - name: unchecked-type-assertion + disabled: true + - name: confusing-results + disabled: true + - name: unused-parameter + disabled: true + - name: modifies-value-receiver + disabled: true + - name: var-naming + disabled: true + - name: early-return + disabled: true + - name: var-naming + disabled: true + - name: confusing-naming + disabled: true + - name: defer + disabled: true + # Disabled in favour of unparam. + - name: unused-parameter + disabled: true + - name: unhandled-error + disabled: false + arguments: + - 'fmt.Printf' + - 'fmt.Print' + - 'fmt.Println' + - 'myFunction' \ No newline at end of file