Skip to content

Commit 3c0e751

Browse files
committed
fix sarif on test
1 parent ed64ef0 commit 3c0e751

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

tools/dartanalyzerRunner.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ func RunDartAnalyzer(workDirectory string, installationDirectory string, binary
1818

1919
configFiles := []string{"analysis_options.yaml", "analysis_options.yml"}
2020
dartAnalyzerPath := filepath.Join(installationDirectory, "bin", "dart")
21-
fmt.Println(dartAnalyzerPath)
2221

2322
args := []string{"analyze", "--format", "machine"}
2423
// Add files to analyze - if no files specified, analyze current directory
@@ -32,8 +31,6 @@ func RunDartAnalyzer(workDirectory string, installationDirectory string, binary
3231

3332
cmd.Dir = workDirectory
3433

35-
fmt.Println("Running", cmd.String())
36-
3734
// Check if any config file exists
3835
configExists := false
3936
for _, configFile := range configFiles {

tools/dartanalyzerRunner_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func TestRunDartAnalyzerToFile(t *testing.T) {
4141
}
4242
obtainedSarif := string(obtainedSarifBytes)
4343

44-
filePrefix := "file://" + currentDirectory + "/"
44+
filePrefix := currentDirectory + "/"
4545
actualSarif := strings.ReplaceAll(obtainedSarif, filePrefix, "")
4646

4747
expectedSarif := strings.TrimSpace(string(expectedSarifBytes))

tools/testdata/repositories/dartanalizer/expected.sarif

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{
99
"physicalLocation": {
1010
"artifactLocation": {
11-
"uri": "/Users/heliorocha/dev/codacy/codacy-cli-v2/tools/testdata/repositories/dartanalizer/src/main.dart"
11+
"uri": "testdata/repositories/dartanalizer/src/main.dart"
1212
},
1313
"region": {
1414
"startLine": 2
@@ -26,7 +26,7 @@
2626
{
2727
"physicalLocation": {
2828
"artifactLocation": {
29-
"uri": "/Users/heliorocha/dev/codacy/codacy-cli-v2/tools/testdata/repositories/dartanalizer/src/main.dart"
29+
"uri": "testdata/repositories/dartanalizer/src/main.dart"
3030
},
3131
"region": {
3232
"startLine": 6
@@ -44,7 +44,7 @@
4444
{
4545
"physicalLocation": {
4646
"artifactLocation": {
47-
"uri": "/Users/heliorocha/dev/codacy/codacy-cli-v2/tools/testdata/repositories/dartanalizer/src/main.dart"
47+
"uri": "testdata/repositories/dartanalizer/src/main.dart"
4848
},
4949
"region": {
5050
"startLine": 23
@@ -62,7 +62,7 @@
6262
{
6363
"physicalLocation": {
6464
"artifactLocation": {
65-
"uri": "/Users/heliorocha/dev/codacy/codacy-cli-v2/tools/testdata/repositories/dartanalizer/src/main.dart"
65+
"uri": "testdata/repositories/dartanalizer/src/main.dart"
6666
},
6767
"region": {
6868
"startLine": 26
@@ -80,7 +80,7 @@
8080
{
8181
"physicalLocation": {
8282
"artifactLocation": {
83-
"uri": "/Users/heliorocha/dev/codacy/codacy-cli-v2/tools/testdata/repositories/dartanalizer/src/main.dart"
83+
"uri": "testdata/repositories/dartanalizer/src/main.dart"
8484
},
8585
"region": {
8686
"startLine": 31
@@ -98,7 +98,7 @@
9898
{
9999
"physicalLocation": {
100100
"artifactLocation": {
101-
"uri": "/Users/heliorocha/dev/codacy/codacy-cli-v2/tools/testdata/repositories/dartanalizer/src/main.dart"
101+
"uri": "testdata/repositories/dartanalizer/src/main.dart"
102102
},
103103
"region": {
104104
"startLine": 35
@@ -116,7 +116,7 @@
116116
{
117117
"physicalLocation": {
118118
"artifactLocation": {
119-
"uri": "/Users/heliorocha/dev/codacy/codacy-cli-v2/tools/testdata/repositories/dartanalizer/src/main.dart"
119+
"uri": "testdata/repositories/dartanalizer/src/main.dart"
120120
},
121121
"region": {
122122
"startLine": 35

0 commit comments

Comments
 (0)