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

mlange-42 / modo / 13146653622

04 Feb 2025 11:14PM CUT coverage: 72.623% (+0.03%) from 72.594%
13146653622

push

github

web-flow
Implement `from .mod import X as Y` re-exports (#189)

124 of 169 new or added lines in 6 files covered. (73.37%)

1 existing line in 1 file now uncovered.

1650 of 2272 relevant lines covered (72.62%)

26.84 hits per line

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

61.73
/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✔
NEW
12
                        tempPkg := *p.Packages[i]
×
NEW
13
                        tempPkg.MemberName = MemberName{Name: newName}
×
NEW
14
                        p.Packages[i] = &tempPkg
×
NEW
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
                        //proc.renameStruct(p.Structs[i], newPath, newName)
2✔
40
                        tempMod := *p.Structs[i]
2✔
41
                        tempMod.MemberName = MemberName{Name: newName}
2✔
42
                        p.Structs[i] = &tempMod
2✔
43
                }
2✔
44
        }
45
        for i := range p.Traits {
7✔
46
                newPath := ownPath + "." + p.Traits[i].Name
2✔
47
                if newName, ok := proc.renameExports[newPath]; ok {
2✔
NEW
48
                        //proc.renameTrait(p.Traits[i], newPath, newName)
×
NEW
49
                        tempMod := *p.Traits[i]
×
NEW
50
                        tempMod.MemberName = MemberName{Name: newName}
×
NEW
51
                        p.Traits[i] = &tempMod
×
NEW
52
                }
×
53
        }
54
        for i := range p.Functions {
7✔
55
                newPath := ownPath + "." + p.Functions[i].Name
2✔
56
                if newName, ok := proc.renameExports[newPath]; ok {
2✔
NEW
57
                        tempMod := *p.Functions[i]
×
NEW
58
                        tempMod.MemberName = MemberName{Name: newName}
×
NEW
59
                        p.Functions[i] = &tempMod
×
NEW
60
                }
×
61
        }
62
}
63

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