Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sonar: fix warnings #10034

Merged
merged 3 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version: '1.20'
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ go.work*
docker-compose.*.yml
.env
coverage.out
coverage-erigon.out
coverage-erigon-lib.out
coverage-total.out

dist
__debug_bin
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ test-erigon-ext:

## test: run unit tests with a 100s timeout
test: test-erigon-lib
$(GOTEST) --timeout 10m -coverprofile=coverage-erigon.out
$(GOTEST) --timeout 10m -coverprofile=coverage.out

test3: test-erigon-lib
$(GOTEST) --timeout 10m -tags $(BUILD_TAGS),e3
Expand Down Expand Up @@ -313,7 +313,7 @@ user_macos:
## coverage: run code coverage report and output total coverage %
.PHONY: coverage
coverage:
@go test -coverprofile=coverage.out ./... > /dev/null 2>&1 && go tool cover -func coverage.out | grep total | awk '{print substr($$3, 1, length($$3)-1)}'
@go test -coverprofile=coverage-total.out ./... > /dev/null 2>&1 && go tool cover -func coverage-total.out | grep total | awk '{print substr($$3, 1, length($$3)-1)}'

## hive: run hive test suite locally using docker e.g. OUTPUT_DIR=~/results/hive SIM=ethereum/engine make hive
.PHONY: hive
Expand Down
2 changes: 2 additions & 0 deletions erigon-lib/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,5 @@ libmdbx/build/*
tests/testdata/*

go.work*

coverage.out
2 changes: 1 addition & 1 deletion erigon-lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ lint-deps: lintci-deps lint-licenses-deps
lint: lintci lint-licenses lint-mod-tidy

test:
$(GOTEST) --count 1 -p 2 -coverprofile=coverage-erigon-lib.out ./...
$(GOTEST) --count 1 -p 2 -coverprofile=coverage.out ./...

test-no-fuzz:
$(GOTEST_NOFUZZ) --count 1 -p 2 ./...
7 changes: 5 additions & 2 deletions sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ sonar.organization=ledgerwatch
sonar.projectName=erigon

sonar.sources=.
sonar.exclusions=**/*.pb.go,cmd/rpcdaemon/graphql/graph/generated.go
sonar.exclusions=**/*.pb.go,**/gen_*.go,**/graphql/graph/generated.go,**/*.sol,common/compiler/*.v.py

sonar.tests=.
sonar.test.inclusions=**/*_test.go,tests/**

sonar.go.coverage.reportPaths=coverage-erigon.out,coverage-erigon-lib.out
sonar.go.coverage.reportPaths=coverage.out,erigon-lib/coverage.out

# The only way to get an accurate analysis of C/C++/Objective-C files is
# by using the SonarSource build-wrapper and setting the property "sonar.cfamily.build-wrapper-output"
Expand All @@ -19,3 +19,6 @@ sonar.go.coverage.reportPaths=coverage-erigon.out,coverage-erigon-lib.out
sonar.c.file.suffixes=-
sonar.cpp.file.suffixes=-
sonar.objc.file.suffixes=-

# Specify whether to scan python files in the repo following python 2 or 3 rules
sonar.python.version=3.12
Loading