(args []string)
| 112 | } |
| 113 | |
| 114 | func (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. |
nothing calls this directly
no test coverage detected