reportScanWarnings prints scan errors to stderr when verbose mode is enabled.
(result *scanner.ScanResult, flags GlobalFlags)
| 362 | |
| 363 | // reportScanWarnings prints scan errors to stderr when verbose mode is enabled. |
| 364 | func reportScanWarnings(result *scanner.ScanResult, flags GlobalFlags) { |
| 365 | if flags.Verbose && len(result.Errors) > 0 { |
| 366 | fmt.Fprintf(os.Stderr, "\nWarning: encountered %d errors during scan:\n", len(result.Errors)) |
| 367 | for _, scanErr := range result.Errors { |
| 368 | fmt.Fprintf(os.Stderr, " %s: %v\n", scanErr.FilePath, scanErr.Error) |
| 369 | } |
| 370 | fmt.Fprintln(os.Stderr) |
| 371 | } |
| 372 | } |
| 373 | |
| 374 | // makeFilePathsRelative converts absolute task file paths to paths relative to baseDir. |
| 375 | func makeFilePathsRelative(tasks []*model.Task, baseDir string) { |