github_repo_statistics 2.3.23 → 2.3.25
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: 279711bd83112f3ccf8e5b4fbab1ac8d8c91a8ded0452be0879fd2d7efaa4f5c
|
4
|
+
data.tar.gz: ac58be810da04b50614d24c52150a3855228c0e5c4c0c6d412c12e3ed46bfe1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c698c616a779c8fbe2fb0b51caa78a8a5ecc4543286763fa04f3469b808f934c8bff84a53cefb34972f1ce0bdea1b7f196a06a3f01b8f132ed41867241c0437c
|
7
|
+
data.tar.gz: b8b27410a4f16a32b2e51431308e9df39f0a094df5831dfab0bfc47ef77890c68705bdfc98eb61357dceb757cc698bb2c722cbb435003b857f7d8d0173488086
|
data/bin/github_repo_statistics
CHANGED
@@ -42,6 +42,10 @@ OptionParser.new do |opts|
|
|
42
42
|
options[:excluded_prs] = excluded_prs
|
43
43
|
end
|
44
44
|
|
45
|
+
opts.on('--excluded-contributor-names STRING', 'Comma-delimited list of excluded Contributros [example: Name1,Name2]') do |excluded_contributor_names|
|
46
|
+
options[:excluded_contributor_names] = excluded_contributor_names
|
47
|
+
end
|
48
|
+
|
45
49
|
opts.on('--steps STRING', 'Number of steps the script will go into the past [default: 1]') do |steps|
|
46
50
|
options[:steps] = steps
|
47
51
|
end
|
@@ -135,6 +139,7 @@ EXCLUDED_PRS = options[:excluded_prs]
|
|
135
139
|
TEAM_TO_FOCUS = options[:team_to_focus]
|
136
140
|
CODEOWNER_TO_FOCUS = options[:codeowner_to_focus]
|
137
141
|
PERCENTILE = options[:percentile] || '100'
|
142
|
+
EXCLUDED_CONTRIBUTOR_NAMES = options[:excluded_contributor_names]
|
138
143
|
|
139
144
|
unless CI
|
140
145
|
puts "\nDirectory: #{REPO_PATH}\n"
|
@@ -192,7 +192,7 @@ class GithubRepoStatistics
|
|
192
192
|
end
|
193
193
|
|
194
194
|
def git_commit_info(file:, start_date:, end_date:, branch: DEFAULT_BRANCH)
|
195
|
-
`git log origin/#{branch} --pretty=format:"%s" --since="#{start_date}" --until="#{end_date}" -- "#{file}"`
|
195
|
+
`git log origin/#{branch} --pretty=format:"%s : %an" --since="#{start_date}" --until="#{end_date}" -- "#{file}"`
|
196
196
|
end
|
197
197
|
|
198
198
|
def new_changes?(file:)
|
@@ -211,11 +211,17 @@ class GithubRepoStatistics
|
|
211
211
|
commit_count = git_commit_count(file:, start_date:, end_date:, branch:).to_i
|
212
212
|
git_log = git_commit_info(file:, start_date:, end_date:, branch:).split("\n")
|
213
213
|
|
214
|
-
if EXCLUDED_PRS
|
214
|
+
if EXCLUDED_PRS
|
215
215
|
excluded_prs = EXCLUDED_PRS.split(',')
|
216
216
|
git_log = git_log.reject { |c| excluded_prs.any? { |pr| c.include?(pr) } }
|
217
217
|
end
|
218
218
|
|
219
|
+
if EXCLUDED_CONTRIBUTOR_NAMES
|
220
|
+
excluded_contributor = EXCLUDED_CONTRIBUTOR_NAMES.split(',')
|
221
|
+
git_log = git_log.reject { |c| excluded_contributors.any? { |cr| c.include?(cr) } }
|
222
|
+
end
|
223
|
+
|
224
|
+
|
219
225
|
prs = git_log.map do |pr|
|
220
226
|
match = pr.match(/#(\d+)/)
|
221
227
|
match[0] if match
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: github_repo_statistics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Serghei Moret
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: date
|