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

umputun / ralphex / 21693946322

04 Feb 2026 10:06PM UTC coverage: 80.959% (+0.5%) from 80.435%
21693946322

Pull #36

github

melonamin
Add git diff stats to dashboard
Pull Request #36: feat(web): interactive plan creation from web dashboard

1048 of 1275 new or added lines in 15 files covered. (82.2%)

5319 of 6570 relevant lines covered (80.96%)

112.15 hits per line

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

72.73
/pkg/web/diff_stats.go
1
package web
2

3
import (
4
        "regexp"
5
        "strconv"
6
)
7

8
// DiffStats holds git diff statistics for a session.
9
type DiffStats struct {
10
        Files     int `json:"files"`
11
        Additions int `json:"additions"`
12
        Deletions int `json:"deletions"`
13
}
14

15
var diffStatsPattern = regexp.MustCompile(`^DIFFSTATS:\s*files=(\d+)\s+additions=(\d+)\s+deletions=(\d+)\s*$`)
16

17
func parseDiffStats(text string) (DiffStats, bool) {
28✔
18
        matches := diffStatsPattern.FindStringSubmatch(text)
28✔
19
        if matches == nil {
54✔
20
                return DiffStats{}, false
26✔
21
        }
26✔
22

23
        files, err := strconv.Atoi(matches[1])
2✔
24
        if err != nil {
2✔
NEW
25
                return DiffStats{}, false
×
NEW
26
        }
×
27
        additions, err := strconv.Atoi(matches[2])
2✔
28
        if err != nil {
2✔
NEW
29
                return DiffStats{}, false
×
NEW
30
        }
×
31
        deletions, err := strconv.Atoi(matches[3])
2✔
32
        if err != nil {
2✔
NEW
33
                return DiffStats{}, false
×
NEW
34
        }
×
35

36
        return DiffStats{
2✔
37
                Files:     files,
2✔
38
                Additions: additions,
2✔
39
                Deletions: deletions,
2✔
40
        }, true
2✔
41
}
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