Skip to content

Commit db141b3

Browse files
committed
Fold Arduino Lint report in logs
The Arduino Lint report is shown in the logs whenever a warning or error is encountered while validating a release before adding it to the index. The report is fairly verbose. Putting it in a "details" section allow the reader to get the quick overview of the indexing results that was provided by the previous log format, while also offering the option to get details about the results of the validation.
1 parent 0c3260d commit db141b3

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Diff for: sync_libraries.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -298,12 +298,18 @@ func syncLibraryTaggedRelease(logger *log.Logger, repo *libraries.Repository, ta
298298
}
299299

300300
report, err := libraries.RunArduinoLint(repo.FolderPath, repoMeta)
301+
reportTemplate := `<a href="https://arduino.github.io/arduino-lint/latest/">Arduino Lint</a> %s:
302+
<details><summary>Click to expand Arduino Lint report</summary>
303+
<hr>
304+
%s
305+
<hr>
306+
</details>`
301307
if err != nil {
302-
logger.Printf("<a href=\"https://arduino.github.io/arduino-lint/latest/\">Arduino Lint</a> found errors:\n%s", report)
308+
logger.Printf(reportTemplate, "found errors", report)
303309
return err
304310
}
305311
if report != nil {
306-
logger.Printf("<a href=\"https://arduino.github.io/arduino-lint/latest/\">Arduino Lint</a> has suggestions for possible improvements:\n%s", report)
312+
logger.Printf(reportTemplate, "has suggestions for possible improvements", report)
307313
}
308314

309315
zipName := libraries.ZipFolderName(library)

0 commit comments

Comments
 (0)