github_repo_statistics 2.3.0 → 2.3.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c68a87b66a8e555e6590746aac45271fabc10897716401acfc022e1bac9c1609
|
4
|
+
data.tar.gz: 6d206daea88a88101e767be234c5a4f34b08b4c8d874953ec3d9e7564873cb5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0afc7b9c120c3245d49cae1cae76428af48d8d435e76dbc396d0369af4640f577dc8416a894055a74248a61d02f5fc2e53095eccf1895889488adbf9a117e461
|
7
|
+
data.tar.gz: f74e864d3d6fbd63468e117f690d5c302661f5757d08c46b6ce3a0b49012d114eb1b9ba4f5e429dc8ede6b3d537044e45fc12706ab1c72c1f182632c6cf94dc3
|
data/Gemfile.lock
CHANGED
data/bin/github_repo_statistics
CHANGED
@@ -37,6 +37,11 @@ OptionParser.new do |opts|
|
|
37
37
|
options[:excluded_files] = excluded_files
|
38
38
|
end
|
39
39
|
|
40
|
+
opts.on('--excluded-commits STRING',
|
41
|
+
'Comma-delimited list of excluded commit keywords [example: SF-1054 Some message,PF-1056 Some other message]') do |excluded_commits|
|
42
|
+
options[:excluded_commits] = excluded_commits
|
43
|
+
end
|
44
|
+
|
40
45
|
opts.on('--steps STRING', 'Number of steps the script will go into the past [default: 1]') do |steps|
|
41
46
|
options[:steps] = steps
|
42
47
|
end
|
@@ -106,6 +111,7 @@ HOTSPOT = options[:hotspot_files] || false
|
|
106
111
|
FILE_OUTPUT = options[:file_output] || false
|
107
112
|
CODE_EXTENSIONS = options[:code_extension] ? options[:code_extension].split(',') : ['.swift', '.kt']
|
108
113
|
EXCLUDED_FILES = options[:excluded_files]
|
114
|
+
EXCLUDED_COMMITS = options[:excluded_commits]
|
109
115
|
|
110
116
|
unless CI
|
111
117
|
puts "\nDirectory: #{REPO_PATH}\n"
|
@@ -182,7 +182,7 @@ class GithubRepoStatistics
|
|
182
182
|
end
|
183
183
|
|
184
184
|
def new_changes?(file:)
|
185
|
-
git_commit_info(file:, start_date: DateTime.now -
|
185
|
+
git_commit_info(file:, start_date: DateTime.now - 7, end_date: DateTime.now) == "" ? false : true
|
186
186
|
end
|
187
187
|
|
188
188
|
def analyze_changed_files(uniq_code_files_with_changes:, start_date:, end_date:)
|
@@ -196,6 +196,11 @@ class GithubRepoStatistics
|
|
196
196
|
filename = File.basename(file)
|
197
197
|
commit_count = git_commit_count(file:, start_date:, end_date:).to_i
|
198
198
|
git_log = git_commit_info(file:, start_date:, end_date:).split("\n")
|
199
|
+
|
200
|
+
if EXCLUDED_COMMITS
|
201
|
+
git_log = git_log.reject { |c| c.include?(EXCLUDED_COMMITS) }
|
202
|
+
end
|
203
|
+
|
199
204
|
prs = git_log.map do |pr|
|
200
205
|
match = pr.match(/#(\d+)/)
|
201
206
|
if match
|
@@ -343,7 +348,7 @@ class GithubRepoStatistics
|
|
343
348
|
|
344
349
|
if FILE_OUTPUT
|
345
350
|
CSV.open('hotspot.csv', 'w') do |csv|
|
346
|
-
csv << ['File', '
|
351
|
+
csv << ['File', 'Updated in the past week', 'Contributors', 'Lines', 'Commits', 'Owner', 'PRs']
|
347
352
|
hotspot_output.each do |row|
|
348
353
|
csv << row
|
349
354
|
end
|
@@ -351,7 +356,7 @@ class GithubRepoStatistics
|
|
351
356
|
else
|
352
357
|
puts "\n *Hotspot files(#{filtered_top_touched_files.count}):*\n"
|
353
358
|
hotspot_output.each do |row|
|
354
|
-
puts " #{row[0]} Contributors: #{row[1]}
|
359
|
+
puts " #{row[0]} Contributors: #{row[1]} Updated in the past week: #{row[2]} Lines: #{row[3]} Commits: #{row[4]} Owner: #{row[5]} PRs: #{row[6]}"
|
355
360
|
end
|
356
361
|
end
|
357
362
|
end
|
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.2
|
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-05-
|
11
|
+
date: 2024-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: date
|