MCPcopy Index your code
hub / github.com/conventionalcommit/commitlint / readStdInPipe

Function readStdInPipe

internal/cmd/lint.go:171–190  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

169}
170
171func readStdInPipe() (string, error) {
172 stat, err := os.Stdin.Stat()
173 if err != nil {
174 return "", err
175 }
176
177 // user input from terminal
178 if (stat.Mode() & os.ModeCharDevice) != 0 {
179 // not handling this case
180 return "", nil
181 }
182
183 // user input from stdin pipe
184 readBytes, err := io.ReadAll(os.Stdin)
185 if err != nil {
186 return "", err
187 }
188 s := string(readBytes)
189 return strings.TrimSpace(s), nil
190}
191
192func hasErrorSeverity(result *lint.Result) bool {
193 for _, i := range result.Issues() {

Callers 1

getCommitMsgFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected