MCPcopy
hub / github.com/perkeep/perkeep / RunCommand

Method RunCommand

dev/devcam/hook.go:114–132  ·  view source on GitHub ↗
(args []string)

Source from the content-addressed store, hash-verified

112}
113
114func (c *hookCmd) RunCommand(args []string) error {
115 if err := c.installHook(); err != nil {
116 return err
117 }
118 if len(args) == 0 {
119 return nil
120 }
121 switch args[0] {
122 case "pre-commit":
123 if err := c.hookPreCommit(args[1:]); err != nil {
124 if !(len(args) > 1 && args[1] == "test") {
125 printf("You can override these checks with 'git commit --no-verify'\n")
126 }
127 cmdmain.ExitWithFailure = true
128 return err
129 }
130 }
131 return nil
132}
133
134// hookPreCommit does the following checks, in order:
135// gofmt, and trailing space.

Callers

nothing calls this directly

Calls 3

installHookMethod · 0.95
hookPreCommitMethod · 0.95
printfFunction · 0.85

Tested by

no test coverage detected