code_ownership 1.32.10 → 1.32.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/code_ownership/mapper.rb +2 -1
- data/lib/code_ownership.rb +7 -11
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 766c909e87feb435319240d22675e5bd3bbbb2da5e9984098df27eb6586b2d46
|
4
|
+
data.tar.gz: 74e9e35278a45fce5aecf0de4131c56785c774eb6abe9e3d6db599f3bf6332f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eae6b000156ff509afe12b70019d3b73a62d30718f890f62dcd8ff46c8a03687e5cbc041463ef5b28e0de85bbb96c72799db95334d575bd5b42669ece4960885
|
7
|
+
data.tar.gz: e4c4b07430f1b611fb2e1493210a67c2a0e69013fdeddaa2042f8b6334e3b1c66d666343030da1af79b7af2dd9d8873af88556143cfa60406aa0991f72f7a9be
|
@@ -68,9 +68,10 @@ module CodeOwnership
|
|
68
68
|
|
69
69
|
Mapper.all.each do |mapper|
|
70
70
|
mapped_files = mapper.globs_to_owner(Private.tracked_files)
|
71
|
+
glob_to_owner_map_by_mapper_description[mapper.description] ||= {}
|
72
|
+
|
71
73
|
mapped_files.each do |glob, owner|
|
72
74
|
next if owner.nil?
|
73
|
-
glob_to_owner_map_by_mapper_description[mapper.description] ||= {}
|
74
75
|
glob_to_owner_map_by_mapper_description.fetch(mapper.description)[glob] = owner
|
75
76
|
end
|
76
77
|
end
|
data/lib/code_ownership.rb
CHANGED
@@ -43,27 +43,23 @@ module CodeOwnership
|
|
43
43
|
|
44
44
|
sig { params(team: T.any(CodeTeams::Team, String)).returns(String) }
|
45
45
|
def for_team(team)
|
46
|
-
Private.load_configuration!
|
47
|
-
|
48
46
|
team = T.must(CodeTeams.find(team)) if team.is_a?(String)
|
49
47
|
ownership_information = T.let([], T::Array[String])
|
50
48
|
|
51
49
|
ownership_information << "# Code Ownership Report for `#{team.name}` Team"
|
52
|
-
|
53
|
-
|
54
|
-
|
50
|
+
|
51
|
+
Private.glob_cache.raw_cache_contents.each do |mapper_description, glob_to_owning_team_map|
|
52
|
+
ownership_information << "## #{mapper_description}"
|
55
53
|
ownership_for_mapper = []
|
56
|
-
|
57
|
-
next if
|
58
|
-
|
59
|
-
ownership_for_mapper << "- #{line}"
|
60
|
-
end
|
54
|
+
glob_to_owning_team_map.each do |glob, owning_team|
|
55
|
+
next if owning_team != team
|
56
|
+
ownership_for_mapper << "- #{glob}"
|
61
57
|
end
|
62
58
|
|
63
59
|
if ownership_for_mapper.empty?
|
64
60
|
ownership_information << 'This team owns nothing in this category.'
|
65
61
|
else
|
66
|
-
ownership_information += ownership_for_mapper
|
62
|
+
ownership_information += ownership_for_mapper.sort
|
67
63
|
end
|
68
64
|
|
69
65
|
ownership_information << ""
|