• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

evilmartians / lefthook / 17830571427

18 Sep 2025 01:39PM UTC coverage: 71.918% (+0.5%) from 71.399%
17830571427

push

github

web-flow
refactor: better scope subpackages (#1132)

48 of 50 new or added lines in 6 files covered. (96.0%)

3506 of 4875 relevant lines covered (71.92%)

3.2 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

53.57
/internal/run/controller/run.go
1
package controller
2

3
import (
4
        "bytes"
5
        "context"
6
        "io"
7
        "os"
8

9
        "github.com/evilmartians/lefthook/internal/log"
10
        "github.com/evilmartians/lefthook/internal/run/controller/exec"
11
        "github.com/evilmartians/lefthook/internal/system"
12
)
13

14
func (c *Controller) run(ctx context.Context, name string, follow bool, opts exec.Options) bool {
6✔
15
        log.SetName(name)
6✔
16
        defer log.UnsetName(name)
6✔
17

6✔
18
        // If the command does not explicitly `use_stdin` no input will be provided.
6✔
19
        var in io.Reader = system.NullReader
6✔
20
        if opts.UseStdin {
6✔
NEW
21
                in = c.cachedStdin
×
22
        }
×
23

24
        if (follow || opts.Interactive) && log.Settings.LogExecution() {
6✔
25
                log.Execution(name, nil, nil)
×
26

×
27
                var out io.Writer
×
28
                if log.Settings.LogExecutionOutput() {
×
29
                        out = os.Stdout
×
30
                } else {
×
31
                        out = io.Discard
×
32
                }
×
33

NEW
34
                err := c.executor.Execute(ctx, opts, in, out)
×
35

×
36
                return err == nil
×
37
        }
38

39
        out := new(bytes.Buffer)
6✔
40

6✔
41
        err := c.executor.Execute(ctx, opts, in, out)
6✔
42

6✔
43
        log.Execution(name, err, out)
6✔
44

6✔
45
        return err == nil
6✔
46
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc