diff --git a/.github/workflows/lint.yml b/.github/workflows/golangci_lint.yml similarity index 52% rename from .github/workflows/lint.yml rename to .github/workflows/golangci_lint.yml index 3e00cc31c..24b0986f9 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/golangci_lint.yml @@ -1,4 +1,4 @@ -name: Linters +name: golangci-lint on: push: tags: @@ -9,7 +9,7 @@ on: jobs: golangci: - name: lint + name: golangci-lint runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -19,13 +19,6 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v3.7.0 with: - version: v1.49 - markdownlint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: markdownlint-cli - uses: nosborn/github-action-markdown-cli@v3.2.0 - with: - files: . - config-file: .markdownlint.yaml \ No newline at end of file + config-path: .golangci.yml + version: v1.49.0 + skip-cache: true \ No newline at end of file diff --git a/.github/workflows/markdown_lint.yml b/.github/workflows/markdown_lint.yml new file mode 100644 index 000000000..40a5984b7 --- /dev/null +++ b/.github/workflows/markdown_lint.yml @@ -0,0 +1,20 @@ +name: markdown-lint +on: + push: + tags: + - v* + branches: + - main + pull_request: + +jobs: + markdownlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: markdownlint-cli + uses: nosborn/github-action-markdown-cli@v3.2.0 + with: + files: . + config_file: .markdownlint.yaml + ignore_files: ./x/gamm/**/* \ No newline at end of file diff --git a/.golangci.yml b/.golangci.yml index d1808c472..8d3f7d9a1 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,12 +1,6 @@ run: timeout: 5m modules-download-mode: readonly - # mempool and indexer code is borrowed from Tendermint - skip-dirs: - - mempool - - state/indexer - - state/txindex - - vue skip-files: - da/celestia/mock/server.go - ./*_test.go @@ -20,12 +14,9 @@ linters: - revive - deadcode - errcheck - - gofmt - - goimports - gosimple - govet - ineffassign - - misspell - staticcheck - structcheck - typecheck @@ -36,6 +27,8 @@ linters: issues: exclude-use-default: false + exclude: + - "^.*SA1019.*$" # Excluding SA1019 errors linters-settings: revive: diff --git a/.markdownlint.yaml b/.markdownlint.yaml index 477492fa4..f0519ab82 100644 --- a/.markdownlint.yaml +++ b/.markdownlint.yaml @@ -1,9 +1,24 @@ default: true -MD010: - code_blocks: false + +MD010: false MD013: false -MD024: - allow_different_nesting: true +MD024: false MD033: - allowed_elements: ["img"] + allowed_elements: ["img", "a"] +MD041: false +MD037: false +MD034: false +MD009: false +MD004: false +MD012: false +MD022: false +MD026: false +MD028: false +MD029: false +MD031: false +MD032: false +MD036: false +MD047: false +MD051: false +MD053: false diff --git a/osmoutils/sdkrand.go b/osmoutils/sdkrand.go index 6a0126cbd..8be8fcfe2 100644 --- a/osmoutils/sdkrand.go +++ b/osmoutils/sdkrand.go @@ -7,23 +7,24 @@ import ( "math/rand" "time" + sdk_math "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" ) // RandPositiveInt get a rand positive sdk.Int -func RandPositiveInt(r *rand.Rand, max sdk.Int) (sdk.Int, error) { +func RandPositiveInt(r *rand.Rand, max sdk_math.Int) (sdk_math.Int, error) { if !max.GTE(sdk.OneInt()) { - return sdk.Int{}, errors.New("max too small") + return sdk_math.Int{}, errors.New("max too small") } max = max.Sub(sdk.OneInt()) - return sdk.NewIntFromBigInt(new(big.Int).Rand(r, max.BigInt())).Add(sdk.OneInt()), nil + return sdk_math.NewIntFromBigInt(new(big.Int).Rand(r, max.BigInt())).Add(sdk_math.OneInt()), nil } // RandomAmount generates a random amount // Note: The range of RandomAmount includes max, and is, in fact, biased to return max as well as 0. -func RandomAmount(r *rand.Rand, max sdk.Int) sdk.Int { +func RandomAmount(r *rand.Rand, max sdk_math.Int) sdk_math.Int { randInt := big.NewInt(0) switch r.Intn(10) { diff --git a/readme.md b/readme.md index 407868b0c..fe794b393 100644 --- a/readme.md +++ b/readme.md @@ -92,8 +92,8 @@ dymd start You should have a running local node! - ## Adding liquidity + TODO: to play around with the `GAMM` module: @@ -101,5 +101,4 @@ to play around with the `GAMM` module: sh scripts/pools/osmosis_bootstrap.sh ``` - If you have any issues please contact us on [discord](http://discord.gg/dymension) in the Developer section. We are here for you! diff --git a/x/gamm/types/key.go b/x/gamm/types/key.go index 3a2e3b3b2..095856c9c 100644 --- a/x/gamm/types/key.go +++ b/x/gamm/types/key.go @@ -29,7 +29,7 @@ var ( ) func MustGetPoolIdFromShareDenom(denom string) uint64 { - numberStr := strings.TrimLeft(denom, "gamm/pool/") + numberStr := strings.TrimLeft(denom, "gamm/pool/") //nolint:staticcheck number, err := strconv.Atoi(numberStr) if err != nil { panic(err) @@ -38,7 +38,7 @@ func MustGetPoolIdFromShareDenom(denom string) uint64 { } func ValidatePoolShareDenom(denom string) error { - numberStr := strings.TrimLeft(denom, "gamm/pool/") + numberStr := strings.TrimLeft(denom, "gamm/pool/") //nolint:staticcheck _, err := strconv.Atoi(numberStr) if err != nil { return err