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

mlange-42 / modo / 13169134435

06 Feb 2025 12:22AM CUT coverage: 72.707%. Remained the same
13169134435

Pull #210

github

web-flow
Merge 6ebde7c15 into 5fec519e3
Pull Request #210: Don't warn on missing self arg docs, also for traits

1 of 1 new or added line in 1 file covered. (100.0%)

1649 of 2268 relevant lines covered (72.71%)

26.88 hits per line

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

63.64
/internal/document/rename.go
1
package document
2

3
func (proc *Processor) renameAll(p *Package) {
3✔
4
        proc.renamePackage(p, p.Name)
3✔
5
}
3✔
6

7
func (proc *Processor) renamePackage(p *Package, ownPath string) {
5✔
8
        for i := range p.Packages {
7✔
9
                newPath := ownPath + "." + p.Packages[i].Name
2✔
10
                proc.renamePackage(p.Packages[i], newPath)
2✔
11
                if newName, ok := proc.renameExports[newPath]; ok {
2✔
12
                        tempPkg := *p.Packages[i]
×
13
                        tempPkg.MemberName = MemberName{Name: newName}
×
14
                        p.Packages[i] = &tempPkg
×
15
                }
×
16
        }
17

18
        for i := range p.Modules {
10✔
19
                newPath := ownPath + "." + p.Modules[i].Name
5✔
20
                proc.renameModule(p.Modules[i], newPath)
5✔
21
                if newName, ok := proc.renameExports[newPath]; ok {
7✔
22
                        tempMod := *p.Modules[i]
2✔
23
                        tempMod.MemberName = MemberName{Name: newName}
2✔
24
                        p.Modules[i] = &tempMod
2✔
25
                }
2✔
26
        }
27

28
        for i := range p.Aliases {
9✔
29
                newPath := ownPath + "." + p.Aliases[i].Name
4✔
30
                if newName, ok := proc.renameExports[newPath]; ok {
8✔
31
                        tempMod := *p.Aliases[i]
4✔
32
                        tempMod.MemberName = MemberName{Name: newName}
4✔
33
                        p.Aliases[i] = &tempMod
4✔
34
                }
4✔
35
        }
36
        for i := range p.Structs {
8✔
37
                newPath := ownPath + "." + p.Structs[i].Name
3✔
38
                if newName, ok := proc.renameExports[newPath]; ok {
5✔
39
                        tempMod := *p.Structs[i]
2✔
40
                        tempMod.MemberName = MemberName{Name: newName}
2✔
41
                        p.Structs[i] = &tempMod
2✔
42
                }
2✔
43
        }
44
        for i := range p.Traits {
7✔
45
                newPath := ownPath + "." + p.Traits[i].Name
2✔
46
                if newName, ok := proc.renameExports[newPath]; ok {
2✔
47
                        tempMod := *p.Traits[i]
×
48
                        tempMod.MemberName = MemberName{Name: newName}
×
49
                        p.Traits[i] = &tempMod
×
50
                }
×
51
        }
52
        for i := range p.Functions {
7✔
53
                newPath := ownPath + "." + p.Functions[i].Name
2✔
54
                if newName, ok := proc.renameExports[newPath]; ok {
2✔
55
                        tempMod := *p.Functions[i]
×
56
                        tempMod.MemberName = MemberName{Name: newName}
×
57
                        p.Functions[i] = &tempMod
×
58
                }
×
59
        }
60
}
61

62
func (proc *Processor) renameModule(m *Module, ownPath string) {
5✔
63
        for i := range m.Aliases {
10✔
64
                newPath := ownPath + "." + m.Aliases[i].Name
5✔
65
                if newName, ok := proc.renameExports[newPath]; ok {
5✔
66
                        tempMod := *m.Aliases[i]
×
67
                        tempMod.MemberName = MemberName{Name: newName}
×
68
                        m.Aliases[i] = &tempMod
×
69
                }
×
70
        }
71
        for i := range m.Structs {
10✔
72
                newPath := ownPath + "." + m.Structs[i].Name
5✔
73
                if newName, ok := proc.renameExports[newPath]; ok {
5✔
74
                        tempMod := *m.Structs[i]
×
75
                        tempMod.MemberName = MemberName{Name: newName}
×
76
                        m.Structs[i] = &tempMod
×
77
                }
×
78
        }
79
        for i := range m.Traits {
6✔
80
                newPath := ownPath + "." + m.Traits[i].Name
1✔
81
                if newName, ok := proc.renameExports[newPath]; ok {
1✔
82
                        tempMod := *m.Traits[i]
×
83
                        tempMod.MemberName = MemberName{Name: newName}
×
84
                        m.Traits[i] = &tempMod
×
85
                }
×
86
        }
87
        for i := range m.Functions {
6✔
88
                newPath := ownPath + "." + m.Functions[i].Name
1✔
89
                if newName, ok := proc.renameExports[newPath]; ok {
1✔
90
                        tempMod := *m.Functions[i]
×
91
                        tempMod.MemberName = MemberName{Name: newName}
×
92
                        m.Functions[i] = &tempMod
×
93
                }
×
94
        }
95
}
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