git_ownership_insights 2.0.6 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2f6a04d3018e987e2762a5037c474904cf6602fded2e27f08df2789f0dc99c3
|
4
|
+
data.tar.gz: 8ae4f2dc116cf482b4ff0f7a10225e1d6aeefa4a1f7219a7909eca541a4a51f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef5dc57fa25ac45c1732177686c947bd30f373fce422a1208993da14e52a104f15ceab0902005c48b789428c2fcd6edac2e851303457ab21aaa7664ffde0a853
|
7
|
+
data.tar.gz: 0ee6b4f127938b0d4daa4e3f6b1e35491e79698af297bec7f96321313180fd4a2cf2a553727c5da3559879bbc152e2be175deac9ada09ebd210ce9d4c03a1b65
|
data/Gemfile.lock
CHANGED
data/bin/git_ownership_insights
CHANGED
@@ -54,16 +54,6 @@ OptionParser.new do |opts|
|
|
54
54
|
options[:team_regex] = team_regex
|
55
55
|
end
|
56
56
|
|
57
|
-
opts.on('--top-contributing-team STRING',
|
58
|
-
'Limit of top contributed to the directory teams in codeownership data [default: 5]') do |top_contributing_team|
|
59
|
-
options[:top_contributing_team] = top_contributing_team
|
60
|
-
end
|
61
|
-
|
62
|
-
opts.on('--top-touched-files STRING',
|
63
|
-
'Limit of top touched files by individual contributors in codeownership data [default: 5]') do |top_touched_files|
|
64
|
-
options[:top_touched_files] = top_touched_files
|
65
|
-
end
|
66
|
-
|
67
57
|
opts.on('--codeowners-path STRING', 'Path to CODEOWNERS file [default: .github/CODEOWNERS]') do |codeowners_path|
|
68
58
|
options[:codeowners_path] = codeowners_path
|
69
59
|
end
|
@@ -107,8 +97,6 @@ end.parse!
|
|
107
97
|
EXCLUSIONS = options[:exclusions]&.split(',')
|
108
98
|
REPO_PATH = options[:path] || '.'
|
109
99
|
TEAM_REGEX = options[:team_regex] || '[A-Za-z]+'
|
110
|
-
TOP_TOUCHED_FILES = options[:top_touched_files] || 5
|
111
|
-
TOP_CONTRIBUTED_TEAMS = options[:top_contributing_team] || 5
|
112
100
|
CODEOWNERS_PATH = options[:codeowners_path] || '.github/CODEOWNERS'
|
113
101
|
BIG_FILE_SIZE = options[:big_file_size] || 250
|
114
102
|
CI = options[:ci] || false
|
@@ -131,8 +119,6 @@ unless CI
|
|
131
119
|
puts "Lines of code limit (big files) for the hotspot calculation: #{BIG_FILE_SIZE}"
|
132
120
|
puts "Hotspot detailed output is: #{options[:hotspot_files] ? 'on' : 'off'}\n"
|
133
121
|
puts "CODEOWNERS output is: #{options[:codeowners] ? 'on' : 'off'}\n"
|
134
|
-
puts "Limit of the teams shown in codeownership data: #{TOP_CONTRIBUTED_TEAMS}"
|
135
|
-
puts "Limit of the files shown in codeownership data: #{TOP_TOUCHED_FILES}"
|
136
122
|
puts "Output to file mode is: #{options[:file_output] ? 'on' : 'off'}\n"
|
137
123
|
puts "CI mode is: #{options[:ci] ? 'on' : 'off'}\n"
|
138
124
|
puts "Debug mode is: #{options[:debug] ? 'on' : 'off'}\n\n"
|
@@ -75,13 +75,9 @@ class GitOwnershipInsights
|
|
75
75
|
|
76
76
|
# Sort owners_data by total count in descending order
|
77
77
|
sorted_owners_data = owners_data.sort_by { |_, data| -data[:churn_count] }
|
78
|
-
|
79
|
-
# Take the last 5 elements
|
80
|
-
top_owners_data = sorted_owners_data.last(TOP_CONTRIBUTED_TEAMS.to_i)
|
81
|
-
|
82
78
|
converted_team_map = file_team_map.transform_keys { |key| File.basename(key) }
|
83
79
|
|
84
|
-
|
80
|
+
sorted_owners_data.each do |owner, data|
|
85
81
|
output += "\n #{owner.split('/').last}:\n Total Count: #{data[:churn_count]}\n"
|
86
82
|
data[:directories].each do |dir, dir_data|
|
87
83
|
output += " Directory: #{dir}\n Top files:\n"
|
@@ -5,8 +5,6 @@ require_relative '../lib/git_ownership_insights/git_ownership_insight'
|
|
5
5
|
RSpec.describe GitOwnershipInsights do
|
6
6
|
EXCLUSIONS = %w[exclusion1 exclusion2].freeze
|
7
7
|
TEAM_REGEX = '[A-Za-z]+'
|
8
|
-
TOP_TOUCHED_FILES = 5
|
9
|
-
TOP_CONTRIBUTED_TEAMS = 5
|
10
8
|
CODEOWNERS_PATH = '.github/CODEOWNERS'
|
11
9
|
BIG_FILE_SIZE = 250
|
12
10
|
CI = false
|