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

chore: sonar ignore directories with their own go.mods #20509

Merged
merged 5 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
26 changes: 11 additions & 15 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
run:
tests: true
timeout: 15m
sort-results: true
allow-parallel-runners: true
exclude-dir: testutil/testdata
skip-files:
- server/grpc/gogoreflection/fix_registration.go
- "fix_registration.go"
- ".*\\.pb\\.go$"
- ".*\\.pb\\.gw\\.go$"
- ".*\\.pulsar\\.go$"
- crypto/keys/secp256k1/internal/*
- types/coin_regex.go

build-tags:
build-tags:
- e2e
- ledger
- test_ledger_mock
Expand Down Expand Up @@ -46,6 +35,16 @@ linters:
- unused

issues:
exclude-dirs:
- testutil/testdata
exclude-files:
- server/grpc/gogoreflection/fix_registration.go
- "fix_registration.go"
- ".*\\.pb\\.go$"
- ".*\\.pb\\.gw\\.go$"
- ".*\\.pulsar\\.go$"
- crypto/keys/secp256k1/internal/*
- types/coin_regex.go
exclude-rules:
- text: "Use of weak random number generator"
linters:
Expand Down Expand Up @@ -141,11 +140,8 @@ linters-settings:
extra-rules: true
dogsled:
max-blank-identifiers: 6
maligned:
suggest-new: true
nolintlint:
allow-unused: false
allow-leading-space: true
require-explanation: true
require-specific: false
gosimple:
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sonar.project.monorepo.enabled=true

sonar.sources=.
sonar.exclusions=**/*_test.go,**/*.pb.go,**/*.pulsar.go,**/*.pb.gw.go
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sonar.coverage.exclusions=**/*_test.go,**/testutil/**,**/*.pb.go,**/*.pb.gw.go,**/*.pulsar.go,test_helpers.go,docs/**
sonar.coverage.exclusions=**/*_test.go,**/testutil/**,**/*.pb.go,**/*.pb.gw.go,**/*.pulsar.go,test_helpers.go,docs/**,server/v2/**,store/v2/**,x/tx/**,tools/**,cmd/**,app/**,simapp/**,testutil/**,test_helpers.go,tests/**,test_helpers.go,docs/**,server/v2/**,store/**,x/tx/**,tools/**,simapp/**,tests/**,orm/**,client/v2/**,runtime/v2/**,core/**,store/**,x/evidence,x/feegrant,x/authz,x/auth,x/bank,api,x/gov
Copy link
Contributor

@coderabbitai coderabbitai bot May 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip

Codebase Verification

The exclusions list in sonar-project.properties contains several duplicate entries that need to be removed:

  • **/*.pb.go
  • **/*.pb.gw.go
  • **/*.pulsar.go
  • test_helpers.go
  • docs/**
  • server/v2/**
  • x/tx/**
  • tools/**
  • simapp/**
  • tests/**
  • store/**
  • /testutil/

Please remove these duplicates to clean up the exclusions list.

Analysis chain

Ensure no duplicates in exclusions list.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Check for duplicate entries in the exclusions list.

# Test: Print duplicate entries if any.
awk -F',' '{for(i=1;i<=NF;i++) if(++dup[$i]>1) print $i}' sonar-project.properties

Length of output: 244

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bot is right

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@julienrbrt, thank you for confirming! If there's anything else you need help with or any other changes you'd like to review, feel free to let me know. I'm here to help!

sonar.tests=.
sonar.test.inclusions=**/*_test.go,tests/**,**/testutil/**
sonar.go.coverage.reportPaths=coverage.out,*profile.out
Expand Down
Loading