@@ -27,15 +27,12 @@ import (
27
27
"github.com/arduino/arduino-check/project"
28
28
"github.com/arduino/arduino-check/result"
29
29
"github.com/arduino/arduino-check/result/feedback"
30
- "github.com/arduino/arduino-check/result/outputformat"
31
30
"github.com/sirupsen/logrus"
32
31
)
33
32
34
33
// RunChecks runs all checks for the given project and outputs the results.
35
34
func RunChecks (project project.Type ) {
36
- if configuration .OutputFormat () == outputformat .Text {
37
- fmt .Printf ("Checking %s in %s\n " , project .ProjectType , project .Path )
38
- }
35
+ feedback .Printf ("Checking %s in %s\n " , project .ProjectType , project .Path )
39
36
40
37
checkdata .Initialize (project , configuration .SchemasPath ())
41
38
@@ -52,23 +49,18 @@ func RunChecks(project project.Type) {
52
49
}
53
50
54
51
// Output will be printed after all checks are finished when configured for "json" output format
55
- if configuration .OutputFormat () == outputformat .Text {
56
- fmt .Printf ("Running check %s: " , checkConfiguration .ID )
57
- }
52
+ feedback .Printf ("Running check %s: " , checkConfiguration .ID )
53
+
58
54
checkResult , checkOutput := checkConfiguration .CheckFunction ()
59
55
reportText := result .Results .Record (project , checkConfiguration , checkResult , checkOutput )
60
- if configuration .OutputFormat () == outputformat .Text {
61
- fmt .Print (reportText )
62
- }
56
+ feedback .Print (reportText )
63
57
}
64
58
65
59
// Checks are finished for this project, so summarize its check results in the report.
66
60
result .Results .AddProjectSummary (project )
67
61
68
- if configuration .OutputFormat () == outputformat .Text {
69
- // Print the project check results summary.
70
- fmt .Print (result .Results .ProjectSummaryText (project ))
71
- }
62
+ // Print the project check results summary.
63
+ feedback .Print (result .Results .ProjectSummaryText (project ))
72
64
}
73
65
74
66
// shouldRun returns whether a given check should be run for the given project under the current tool configuration.
0 commit comments