diff --git a/.codecov.yml b/.codecov.yml
index 63c053e74b..97c516774b 100644
--- a/.codecov.yml
+++ b/.codecov.yml
@@ -57,3 +57,6 @@ ignore:
- "x/**/test_common.go"
- "scripts/"
- "contrib"
+ - "**/*.pb.gw.go"
+ - "**/*.pulsar.go"
+ - "tests/mocks/*.go"
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 7b240fc9fb..9f3fb504ca 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -119,11 +119,13 @@ jobs:
name: "${{ github.sha }}-${{ matrix.part }}-coverage"
path: ./${{ matrix.part }}profile.out
- upload-coverage-report:
+ repo-analysis:
runs-on: ubuntu-latest
needs: tests
steps:
- uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
- uses: technote-space/get-diff-action@v6.1.1
with:
PATTERNS: |
@@ -154,35 +156,14 @@ jobs:
- run: |
cat ./*profile.out | grep -v "mode: atomic" >> coverage.txt
if: env.GIT_DIFF
- - name: filter out DONTCOVER
- run: |
- excludelist="$(find ./ -type f -name '*.go' | xargs grep -l 'DONTCOVER')"
- excludelist+=" $(find ./ -type f -name '*.pb.go')"
- excludelist+=" $(find ./ -type f -name '*.pb.gw.go')"
- excludelist+=" $(find ./ -type f -path './tests/mocks/*.go')"
- for filename in ${excludelist}; do
- filename=$(echo $filename | sed 's/^./github.com\/cosmos\/cosmos-sdk/g')
- echo "Excluding ${filename} from coverage report..."
- sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt
- done
- if: env.GIT_DIFF
- - uses: codecov/codecov-action@v3
- with:
- file: ./coverage.txt
- if: env.GIT_DIFF
-
- sonarcloud:
- name: SonarCloud
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
- with:
- fetch-depth: 0
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
+ - uses: codecov/codecov-action@v3
+ with:
+ file: ./coverage.txt
test-rosetta:
runs-on: ubuntu-latest
diff --git a/README.md b/README.md
index 9796c49ea6..bcaf45668e 100644
--- a/README.md
+++ b/README.md
@@ -14,8 +14,11 @@
-
-
+
+
+
+
+
diff --git a/server/export.go b/server/export.go
index 0bdf518417..8739a55107 100644
--- a/server/export.go
+++ b/server/export.go
@@ -1,7 +1,5 @@
package server
-// DONTCOVER
-
import (
"fmt"
"os"
diff --git a/server/start.go b/server/start.go
index 3d70b9787f..41fdaaaec1 100644
--- a/server/start.go
+++ b/server/start.go
@@ -1,7 +1,5 @@
package server
-// DONTCOVER
-
import (
"errors"
"fmt"
diff --git a/server/tm_cmds.go b/server/tm_cmds.go
index 2dc1ddc573..ce65b3981e 100644
--- a/server/tm_cmds.go
+++ b/server/tm_cmds.go
@@ -1,7 +1,5 @@
package server
-// DONTCOVER
-
import (
"fmt"
diff --git a/server/util.go b/server/util.go
index d8f5e17e6d..56db69f289 100644
--- a/server/util.go
+++ b/server/util.go
@@ -32,8 +32,6 @@ import (
"github.com/cosmos/cosmos-sdk/version"
)
-// DONTCOVER
-
// ServerContextKey defines the context key used to retrieve a server.Context from
// a command's Context.
const ServerContextKey = sdk.ContextKey("server.context")
diff --git a/simapp/simd/cmd/testnet.go b/simapp/simd/cmd/testnet.go
index 08722514db..db27a64002 100644
--- a/simapp/simd/cmd/testnet.go
+++ b/simapp/simd/cmd/testnet.go
@@ -1,7 +1,5 @@
package cmd
-// DONTCOVER
-
import (
"bufio"
"encoding/json"
diff --git a/sonar-project.properties b/sonar-project.properties
new file mode 100644
index 0000000000..765c55d3bc
--- /dev/null
+++ b/sonar-project.properties
@@ -0,0 +1,24 @@
+sonar.projectKey=cosmos_cosmos-sdk
+sonar.organization=cosmos
+
+sonar.projectName=Cosmos SDK
+sonar.project.monorepo.enabled=true
+
+sonar.sources=.
+sonar.exclusions=**/*_test.go,tests/**,**/*.pb.go,**/*.pb.gw.go,**/*.pulsar.go,test_helpers.go,docs/**,testutil/testdata/**,testutil/testdata_pulsar/**,**/*.java
+
+sonar.go.coverage.reportPaths=coverage.txt
+sonar.coverage.exclusions=**/*_test.go,tests/**,**/*.pb.go,**/*.pb.gw.go,**/*.pulsar.go,test_helpers.go,docs/**,testutil/testdata/**,testutil/testdata_pulsar/**,**/*.java
+
+sonar.tests=.
+sonar.test.inclusions=**/*_test.go,tests/**
+
+sonar.python.version=3
+sonar.sourceEncoding=UTF-8
+sonar.scm.provider=git
+sonar.pullrequest.github.summary_comment=true
+
+# Exclude C/C++/Objective-C files from analysis
+sonar.c.file.suffixes=-
+sonar.cpp.file.suffixes=-
+sonar.objc.file.suffixes=-
\ No newline at end of file
diff --git a/testutil/testdata/animal.go b/testutil/testdata/animal.go
index 3ce5a00d18..428d3d4b2b 100644
--- a/testutil/testdata/animal.go
+++ b/testutil/testdata/animal.go
@@ -1,6 +1,5 @@
package testdata
-// DONTCOVER
// nolint
import (
diff --git a/x/auth/client/testutil/helpers.go b/x/auth/client/testutil/helpers.go
index 63e6ebdd4b..688d2cacef 100644
--- a/x/auth/client/testutil/helpers.go
+++ b/x/auth/client/testutil/helpers.go
@@ -110,5 +110,3 @@ func TxMultiSignBatchExec(clientCtx client.Context, filename string, from string
return clitestutil.ExecTestCLICmd(clientCtx, cli.GetMultiSignBatchCmd(), args)
}
-
-// DONTCOVER
diff --git a/x/auth/simulation/params.go b/x/auth/simulation/params.go
index 5ce9ac95fc..310e2a49ae 100644
--- a/x/auth/simulation/params.go
+++ b/x/auth/simulation/params.go
@@ -1,7 +1,5 @@
package simulation
-// DONTCOVER
-
import (
"fmt"
"math/rand"
diff --git a/x/bank/simulation/genesis.go b/x/bank/simulation/genesis.go
index 8592b08a31..8547b91846 100644
--- a/x/bank/simulation/genesis.go
+++ b/x/bank/simulation/genesis.go
@@ -1,7 +1,5 @@
package simulation
-// DONTCOVER
-
import (
"encoding/json"
"fmt"
diff --git a/x/bank/simulation/params.go b/x/bank/simulation/params.go
index 08decd4e1e..ab83624c03 100644
--- a/x/bank/simulation/params.go
+++ b/x/bank/simulation/params.go
@@ -1,7 +1,5 @@
package simulation
-// DONTCOVER
-
import (
"fmt"
"math/rand"
diff --git a/x/capability/simulation/genesis.go b/x/capability/simulation/genesis.go
index ab1d11fb3d..8cb45fc034 100644
--- a/x/capability/simulation/genesis.go
+++ b/x/capability/simulation/genesis.go
@@ -1,7 +1,5 @@
package simulation
-// DONTCOVER
-
import (
"encoding/json"
"fmt"
diff --git a/x/capability/types/errors.go b/x/capability/types/errors.go
index 7c582ccbb0..957191eb1c 100644
--- a/x/capability/types/errors.go
+++ b/x/capability/types/errors.go
@@ -1,7 +1,5 @@
package types
-// DONTCOVER
-
import (
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
)
diff --git a/x/distribution/simulation/genesis.go b/x/distribution/simulation/genesis.go
index 036efa28ad..ddda98a939 100644
--- a/x/distribution/simulation/genesis.go
+++ b/x/distribution/simulation/genesis.go
@@ -1,7 +1,5 @@
package simulation
-// DONTCOVER
-
import (
"encoding/json"
"fmt"
diff --git a/x/distribution/simulation/params.go b/x/distribution/simulation/params.go
index 21dc978b27..d4ca518227 100644
--- a/x/distribution/simulation/params.go
+++ b/x/distribution/simulation/params.go
@@ -1,7 +1,5 @@
package simulation
-// DONTCOVER
-
import (
"fmt"
"math/rand"
diff --git a/x/evidence/simulation/genesis.go b/x/evidence/simulation/genesis.go
index 640670ebe9..286a923ecd 100644
--- a/x/evidence/simulation/genesis.go
+++ b/x/evidence/simulation/genesis.go
@@ -1,7 +1,5 @@
package simulation
-// DONTCOVER
-
import (
"encoding/json"
"fmt"
diff --git a/x/evidence/types/errors.go b/x/evidence/types/errors.go
index f448027091..5e5d12e383 100644
--- a/x/evidence/types/errors.go
+++ b/x/evidence/types/errors.go
@@ -1,4 +1,3 @@
-// DONTCOVER
package types
import (
diff --git a/x/evidence/types/params.go b/x/evidence/types/params.go
index 07c23c9854..70ef9f79a4 100644
--- a/x/evidence/types/params.go
+++ b/x/evidence/types/params.go
@@ -4,8 +4,6 @@ import (
"time"
)
-// DONTCOVER
-
// DoubleSignJailEndTime period ends at Max Time supported by Amino
// (Dec 31, 9999 - 23:59:59 GMT).
var DoubleSignJailEndTime = time.Unix(253402300799, 0)
diff --git a/x/genutil/collect.go b/x/genutil/collect.go
index ed48d4174b..fafd3e7573 100644
--- a/x/genutil/collect.go
+++ b/x/genutil/collect.go
@@ -1,7 +1,5 @@
package genutil
-// DONTCOVER
-
import (
"encoding/json"
"errors"
diff --git a/x/genutil/types/types.go b/x/genutil/types/types.go
index 694eebdbe3..89f6355486 100644
--- a/x/genutil/types/types.go
+++ b/x/genutil/types/types.go
@@ -7,8 +7,6 @@ import (
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
)
-// DONTCOVER
-
type (
// AppMap map modules names with their json raw representation.
AppMap map[string]json.RawMessage
diff --git a/x/gov/keeper/invariants.go b/x/gov/keeper/invariants.go
index 0cfcdf32e4..709330df6a 100644
--- a/x/gov/keeper/invariants.go
+++ b/x/gov/keeper/invariants.go
@@ -1,7 +1,5 @@
package keeper
-// DONTCOVER
-
import (
"fmt"
diff --git a/x/gov/module.go b/x/gov/module.go
index b33ade55c2..5f67fa1236 100644
--- a/x/gov/module.go
+++ b/x/gov/module.go
@@ -1,7 +1,5 @@
package gov
-// DONTCOVER
-
import (
"context"
"encoding/json"
diff --git a/x/gov/simulation/genesis.go b/x/gov/simulation/genesis.go
index 20b4b244d5..41cb0e6abd 100644
--- a/x/gov/simulation/genesis.go
+++ b/x/gov/simulation/genesis.go
@@ -1,7 +1,5 @@
package simulation
-// DONTCOVER
-
import (
"encoding/json"
"fmt"
diff --git a/x/gov/simulation/params.go b/x/gov/simulation/params.go
index c0f0ac05ae..138ca15fb0 100644
--- a/x/gov/simulation/params.go
+++ b/x/gov/simulation/params.go
@@ -1,7 +1,5 @@
package simulation
-// DONTCOVER
-
import (
"encoding/json"
"fmt"
diff --git a/x/gov/types/v1/querier.go b/x/gov/types/v1/querier.go
index 11859f61b6..3286b49c35 100644
--- a/x/gov/types/v1/querier.go
+++ b/x/gov/types/v1/querier.go
@@ -4,8 +4,6 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
)
-// DONTCOVER
-
// query endpoints supported by the governance Querier
const (
QueryParams = "params"
diff --git a/x/gov/types/v1beta1/querier.go b/x/gov/types/v1beta1/querier.go
index f08c4898b1..742289797e 100644
--- a/x/gov/types/v1beta1/querier.go
+++ b/x/gov/types/v1beta1/querier.go
@@ -4,8 +4,6 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
)
-// DONTCOVER
-
// query endpoints supported by the governance Querier
const (
QueryParams = "params"
diff --git a/x/mint/simulation/genesis.go b/x/mint/simulation/genesis.go
index be363a4298..f0965c05be 100644
--- a/x/mint/simulation/genesis.go
+++ b/x/mint/simulation/genesis.go
@@ -1,7 +1,5 @@
package simulation
-// DONTCOVER
-
import (
"encoding/json"
"fmt"
diff --git a/x/mint/simulation/params.go b/x/mint/simulation/params.go
index b75b0fc700..34927567e1 100644
--- a/x/mint/simulation/params.go
+++ b/x/mint/simulation/params.go
@@ -1,7 +1,5 @@
package simulation
-// DONTCOVER
-
import (
"fmt"
"math/rand"
diff --git a/x/slashing/simulation/genesis.go b/x/slashing/simulation/genesis.go
index bb46fce222..456d2b06c9 100644
--- a/x/slashing/simulation/genesis.go
+++ b/x/slashing/simulation/genesis.go
@@ -1,7 +1,5 @@
package simulation
-// DONTCOVER
-
import (
"encoding/json"
"fmt"
diff --git a/x/slashing/simulation/params.go b/x/slashing/simulation/params.go
index e7c8fcf491..20d7f68258 100644
--- a/x/slashing/simulation/params.go
+++ b/x/slashing/simulation/params.go
@@ -1,7 +1,5 @@
package simulation
-// DONTCOVER
-
import (
"fmt"
"math/rand"
diff --git a/x/slashing/types/querier.go b/x/slashing/types/querier.go
index 3820a65264..3674101b78 100644
--- a/x/slashing/types/querier.go
+++ b/x/slashing/types/querier.go
@@ -1,7 +1,5 @@
package types
-// DONTCOVER
-
// Query endpoints supported by the slashing querier
const (
QueryParameters = "parameters"
diff --git a/x/staking/simulation/genesis.go b/x/staking/simulation/genesis.go
index afd393c1c7..74fb20e2c7 100644
--- a/x/staking/simulation/genesis.go
+++ b/x/staking/simulation/genesis.go
@@ -1,7 +1,5 @@
package simulation
-// DONTCOVER
-
import (
"encoding/json"
"fmt"
diff --git a/x/staking/simulation/params.go b/x/staking/simulation/params.go
index 30789d3467..e969c7bd22 100644
--- a/x/staking/simulation/params.go
+++ b/x/staking/simulation/params.go
@@ -1,7 +1,5 @@
package simulation
-// DONTCOVER
-
import (
"fmt"
"math/rand"