(confFilePath, fileInput string)
| 37 | } |
| 38 | |
| 39 | func runLint(confFilePath, fileInput string) (lintResult string, hasError bool, err error) { |
| 40 | linter, format, err := getLinter(confFilePath) |
| 41 | if err != nil { |
| 42 | return "", false, err |
| 43 | } |
| 44 | |
| 45 | commitMsg, err := getCommitMsg(fileInput) |
| 46 | if err != nil { |
| 47 | return "", false, err |
| 48 | } |
| 49 | |
| 50 | cleanMsg := cleanupMsg(commitMsg) |
| 51 | |
| 52 | result, err := linter.ParseAndLint(cleanMsg) |
| 53 | if err != nil { |
| 54 | return "", false, err |
| 55 | } |
| 56 | |
| 57 | output, err := format.Format(result) |
| 58 | if err != nil { |
| 59 | return "", false, err |
| 60 | } |
| 61 | return output, hasErrorSeverity(result), nil |
| 62 | } |
| 63 | |
| 64 | func getLinter(confParam string) (*lint.Linter, lint.Formatter, error) { |
| 65 | conf, err := getConfig(confParam) |
no test coverage detected