Skip to content
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ cli
.DS_Store
local_example/
.envrc
coverage.out
6 changes: 5 additions & 1 deletion scripts/tests.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/bin/sh

go test -cover ./...
# -coverprofile writes a machine-readable profile (coverage.out) for SonarQube
# (sonar.go.coverage.reportPaths); -covermode=atomic keeps counts correct under
# concurrent tests. Profile entries are module-import paths, resolved by the
# scanner from the module root (sonar.sources=.).
go test -covermode=atomic -coverprofile=coverage.out ./...
14 changes: 14 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# SonarQube configuration for the Transifex CLI (Go).
# Scan is run from the module root so the import paths in coverage.out resolve.
#
# NOTE: the CI step that runs the scanner is NOT wired up yet. The internal
# Sonar host (sonar.svc.transifex.net) is unreachable from GitHub-hosted
# runners, so the host + runner choice (self-hosted runner vs SonarCloud) is a
# follow-up. sonar.host.url and the auth token are supplied by that CI step,
# not here.
sonar.projectKey=cli
sonar.sources=.
sonar.tests=.
sonar.test.inclusions=**/*_test.go
sonar.exclusions=**/*_test.go,**/vendor/**,examples/**,build/**
sonar.go.coverage.reportPaths=coverage.out
Loading