()
| 167 | } |
| 168 | |
| 169 | func (c *hookCmd) hookTrailingSpace() error { |
| 170 | // see 'pathspec' for the ':!' syntax to ignore a directory. |
| 171 | out, _ := cmdOutputDirErr(".", "git", "diff-index", "--check", "--diff-filter=ACM", "--cached", "HEAD", "--", ".", ":!/vendor/") |
| 172 | if out != "" { |
| 173 | printf("\n%s", out) |
| 174 | printf("Trailing whitespace detected, you need to clean it up manually.\n") |
| 175 | return errors.New("trailing whitespace") |
| 176 | } |
| 177 | return nil |
| 178 | } |
| 179 | |
| 180 | // runGofmt runs the external gofmt command over the local version of staged files. |
| 181 | // It returns the files that need gofmting. |
no test coverage detected