We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 703fa3d commit 7ef7cf2Copy full SHA for 7ef7cf2
configuration/configuration.go
@@ -27,6 +27,7 @@ func Initialize() {
27
// superprojectType = projecttype.All
28
29
outputFormat = "text"
30
+ //reportFilePath = paths.New("report.json")
31
32
feedback.SetFormat(feedback.JSON)
33
logrus.SetLevel(logrus.PanicLevel)
@@ -66,6 +67,13 @@ func OutputFormat() string {
66
67
return outputFormat
68
}
69
70
+var reportFilePath *paths.Path
71
+
72
+// ReportFilePath returns the path to save the report file at.
73
+func ReportFilePath() *paths.Path {
74
+ return reportFilePath
75
+}
76
77
var targetPath *paths.Path
78
79
// TargetPath returns the projects search path.
main.go
@@ -40,6 +40,11 @@ func main() {
40
fmt.Println(result.JSONReport())
41
42
43
+ if configuration.ReportFilePath() != nil {
44
+ // Write report file.
45
+ result.WriteReport()
46
+ }
47
48
if !result.Passed() {
49
os.Exit(errorcodes.ErrGeneric)
50
result/result.go
@@ -207,6 +207,16 @@ func jsonReportRaw() []byte {
207
return reportJSON
208
209
210
+// WriteReport writes a report for all projects to the specified file.
211
+func WriteReport() {
212
+ // Write report file
213
+ err := configuration.ReportFilePath().WriteFile(jsonReportRaw())
214
+ if err != nil {
215
+ feedback.Errorf("Error while writing report: %v", err)
216
+ os.Exit(errorcodes.ErrGeneric)
217
218
219
220
// Passed returns whether the checks passed cumulatively.
221
func Passed() bool {
222
return report.Summary.Pass
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments