git_ownership_insights 1.0.9 → 1.1.0
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: 6b4e4cc30ba7171927e4abab4be4b0193352393d3690f0f687c4ac87518bc72c
|
4
|
+
data.tar.gz: 55ea9d63840f6d95bb5d4f071f712ca76f79b666d50f21b162a05b97a9adb47a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 220d887e9bda7878504ad5f8ae78247a0e8ad445b9bdfbd277334d7fb6505c9ff228232db65cd0009546789c11ea793b39aad53e64d6c6e6eed1980831485bc3
|
7
|
+
data.tar.gz: 11fc632f24d489cce44c3bf224fc787ef0ddfba4527c4017ec1553535571743ae071d901e153a0da870b9215b1b3db2de6bb48be04507bec5ea88a65d3e52ca2
|
@@ -49,7 +49,7 @@ module GitOwnershipInsights
|
|
49
49
|
|
50
50
|
code_files = files.select do |f|
|
51
51
|
extension = File.extname(f)
|
52
|
-
valid_extensions =
|
52
|
+
valid_extensions = CODE_EXTENSIONS
|
53
53
|
valid_extensions.include?(extension)
|
54
54
|
end
|
55
55
|
|
@@ -68,14 +68,12 @@ module GitOwnershipInsights
|
|
68
68
|
def self.count_hotspot_lines(files)
|
69
69
|
code_files = files.select do |f|
|
70
70
|
extension = File.extname(f)
|
71
|
-
valid_extensions =
|
71
|
+
valid_extensions = CODE_EXTENSIONS
|
72
72
|
valid_extensions.include?(extension)
|
73
73
|
end
|
74
74
|
|
75
|
-
# Initialize a counter for files that meet the criteria
|
76
75
|
count = 0
|
77
76
|
|
78
|
-
# Iterate through each file and check the line count
|
79
77
|
code_files.each do |file|
|
80
78
|
lines_count = File.foreach(file).reject { |line| line.match(%r{^\s*(//|/\*.*\*/|\s*$)}) }.count
|
81
79
|
|
@@ -85,6 +83,14 @@ module GitOwnershipInsights
|
|
85
83
|
puts " *Total lines of hotspot code:* #{count}"
|
86
84
|
end
|
87
85
|
|
86
|
+
def self.filter_code_files(files)
|
87
|
+
files.select do |f|
|
88
|
+
extension = File.extname(f)
|
89
|
+
valid_extensions = CODE_EXTENSIONS
|
90
|
+
valid_extensions.include?(extension)
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
88
94
|
def self.contribution_message(directory_path:, duration_in_days:, begin_time:, debug: nil, steps: nil)
|
89
95
|
duration_in_days = duration_in_days.to_i
|
90
96
|
all_teams = []
|
@@ -98,11 +104,7 @@ module GitOwnershipInsights
|
|
98
104
|
all_files_with_changes = `git log --name-only --pretty=format:"" --since="#{start_date}" --until="#{end_date}" "#{directory_path}"`.split.sort
|
99
105
|
excluded_patterns = EXCLUDED_FILES.split(',') if EXCLUDED_FILES
|
100
106
|
|
101
|
-
code_files_with_changes = all_files_with_changes
|
102
|
-
extension = File.extname(f)
|
103
|
-
valid_extensions = CODE_EXTENSIONS
|
104
|
-
valid_extensions.include?(extension)
|
105
|
-
end
|
107
|
+
code_files_with_changes = filter_code_files(all_files_with_changes)
|
106
108
|
|
107
109
|
if EXCLUDED_FILES
|
108
110
|
code_files_with_changes = code_files_with_changes.reject do |file|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git_ownership_insights
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
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-01-
|
11
|
+
date: 2024-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: date
|