in internal/core/system.go [273:318]
func followLinter(client client.APIClient, containerName string, progress *pterm.SpinnerPrinter, scanStages []string) {
reader, err := client.ContainerLogs(context.Background(), containerName, containerLogsOptions)
if err != nil {
log.Fatal(err.Error())
}
defer func(reader io.ReadCloser) {
err := reader.Close()
if err != nil {
log.Fatal(err.Error())
}
}(reader)
scanner := bufio.NewScanner(reader)
interactive := msg.IsInteractive()
for scanner.Scan() {
line := scanner.Text()
if !interactive && len(line) >= dockerSpecialCharsLength {
line = line[dockerSpecialCharsLength:]
}
line = strings.TrimSuffix(line, "\n")
if err == nil || len(line) > 0 {
if strings.Contains(line, "Starting up") {
msg.UpdateText(progress, scanStages[2])
}
if strings.Contains(line, "The Project opening stage completed in") {
msg.UpdateText(progress, scanStages[3])
}
if strings.Contains(line, "The Project configuration stage completed in") {
msg.UpdateText(progress, scanStages[4])
}
if strings.Contains(line, "Detailed summary") {
msg.UpdateText(progress, scanStages[5])
if !msg.IsInteractive() {
msg.EmptyMessage()
}
}
msg.PrintLinterLog(line)
}
if err != nil {
if err != io.EOF {
log.Errorf("Error scanning docker log stream: %s", err)
}
return
}
}
}