MCPcopy Index your code
hub / github.com/perkeep/perkeep / hookTrailingSpace

Method hookTrailingSpace

dev/devcam/hook.go:169–178  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

167}
168
169func (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.

Callers 1

hookPreCommitMethod · 0.95

Calls 2

cmdOutputDirErrFunction · 0.85
printfFunction · 0.85

Tested by

no test coverage detected