MCPcopy Index your code
hub / github.com/conventionalcommit/commitlint / lintMsg

Function lintMsg

internal/cmd/lint.go:23–37  ·  view source on GitHub ↗

lintMsg is the callback function for lint command

(confPath, msgPath string)

Source from the content-addressed store, hash-verified

21
22// lintMsg is the callback function for lint command
23func lintMsg(confPath, msgPath string) error {
24 // NOTE: lint should return with exit code for error case
25 resStr, hasError, err := runLint(confPath, msgPath)
26 if err != nil {
27 return cli.Exit(err, errExitCode)
28 }
29
30 if hasError {
31 return cli.Exit(resStr, errExitCode)
32 }
33
34 // print success message
35 fmt.Println(resStr)
36 return nil
37}
38
39func runLint(confFilePath, fileInput string) (lintResult string, hasError bool, err error) {
40 linter, format, err := getLinter(confFilePath)

Callers 1

newLintCmdFunction · 0.85

Calls 1

runLintFunction · 0.85

Tested by

no test coverage detected