MCPcopy Create free account
hub / github.com/conventionalcommit/commitlint / newLintCmd

Function newLintCmd

internal/cmd/cmd.go:36–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34}
35
36func newLintCmd() *cli.Command {
37 return &cli.Command{
38 Name: "lint",
39 Usage: "Check a commit message",
40 Description: "Reads from stdin (piped), or --message file, or .git/COMMIT_EDITMSG (in that order).",
41 Flags: []cli.Flag{
42 &cli.StringFlag{
43 Name: "config",
44 Aliases: []string{"c"},
45 Usage: "Use this config `FILE` instead of auto-detected one",
46 },
47 &cli.StringFlag{
48 Name: "message",
49 Aliases: []string{"m", "msg"},
50 Usage: "Read commit message from `FILE`",
51 },
52 },
53 Action: func(ctx *cli.Context) error {
54 confFilePath := ctx.String("config")
55 fileInput := ctx.String("message")
56 return lintMsg(confFilePath, fileInput)
57 },
58 }
59}
60
61func newInitCmd() *cli.Command {
62 return &cli.Command{

Callers 1

newCliAppFunction · 0.85

Calls 2

lintMsgFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected