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

mlange-42 / modo / 13139991432

04 Feb 2025 04:20PM CUT coverage: 72.507% (-0.9%) from 73.453%
13139991432

push

github

web-flow
Automatically link source modules (#195)

97 of 113 new or added lines in 7 files covered. (85.84%)

24 existing lines in 3 files now uncovered.

1527 of 2106 relevant lines covered (72.51%)

25.54 hits per line

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

79.63
/document/interface.go
1
package document
2

3
import (
4
        "path"
5
        "unicode"
6
)
7

8
type missingDocs struct {
9
        Who  string
10
        What string
11
}
12

13
type missingStats struct {
14
        Total   int
15
        Missing int
16
}
17

18
type Kinded interface {
19
        GetKind() string
20
}
21

22
type Named interface {
23
        GetName() string
24
        GetFileName() string
25
}
26

27
type Summarized interface {
28
        GetSummary() string
29
}
30

31
type Linked interface {
32
        SetLink(path []string, kind string)
33
        GetLink() string
34
}
35

36
type MemberKind struct {
37
        Kind string
38
}
39

40
func newKind(kind string) MemberKind {
45✔
41
        return MemberKind{Kind: kind}
45✔
42
}
45✔
43

44
func (m *MemberKind) GetKind() string {
52✔
45
        return m.Kind
52✔
46
}
52✔
47

48
type MemberName struct {
49
        Name string
50
}
51

52
func newName(name string) MemberName {
62✔
53
        return MemberName{Name: name}
62✔
54
}
62✔
55

56
func (m *MemberName) GetName() string {
347✔
57
        return m.Name
347✔
58
}
347✔
59

60
func (m *MemberName) GetFileName() string {
211✔
61
        if caseSensitiveSystem {
322✔
62
                return m.Name
111✔
63
        }
111✔
64
        if isCap(m.Name) {
146✔
65
                return m.Name + capitalFileMarker
46✔
66
        }
46✔
67
        return m.Name
54✔
68
}
69

70
type MemberSummary struct {
71
        Summary string
72
}
73

74
func newSummary(summary string) *MemberSummary {
11✔
75
        return &MemberSummary{Summary: summary}
11✔
76
}
11✔
77

78
func (m *MemberSummary) GetSummary() string {
×
79
        return m.Summary
×
80
}
×
81

82
func (m *MemberSummary) CheckMissing(path string, stats *missingStats) (missing []missingDocs) {
22✔
83
        if m.Summary == "" {
31✔
84
                missing = append(missing, missingDocs{path, "description"})
9✔
85
                stats.Missing++
9✔
86
        }
9✔
87
        stats.Total++
22✔
88
        return missing
22✔
89
}
90

91
type MemberDescription struct {
92
        Description string
93
}
94

95
func newDescription(description string) *MemberDescription {
10✔
96
        return &MemberDescription{Description: description}
10✔
97
}
10✔
98

99
func (m *MemberDescription) GetDescription() string {
×
100
        return m.Description
×
101
}
×
102

103
func isCap(s string) bool {
100✔
104
        if len(s) == 0 {
100✔
105
                return false
×
106
        }
×
107
        firstRune := []rune(s)[0]
100✔
108
        return unicode.IsUpper(firstRune)
100✔
109
}
110

111
type MemberLink struct {
112
        Link string
113
}
114

115
func (m *MemberLink) SetLink(p []string, kind string) {
67✔
116
        if kind == "package" {
79✔
117
                m.Link = path.Join(path.Join(p[1:]...), "__init__.mojo")
12✔
118
        } else {
67✔
119
                m.Link = path.Join(p[1:]...) + ".mojo"
55✔
120
        }
55✔
121
}
122

NEW
123
func (m *MemberLink) GetLink() string {
×
NEW
124
        return m.Link
×
NEW
125
}
×
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

© 2025 Coveralls, Inc