git_ownership_insights 1.0.0 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/git_ownership_insights +7 -3
- data/lib/git_ownership_insights/version.rb +1 -1
- 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: 2fa8a6909c32117aee3b0472a09e345027761f5e76ba9a3802b3207ec6305dc7
|
4
|
+
data.tar.gz: add3ba1c16614cf20908fdc71188e9ec1b16f672a9953727c78e87171ae1fed9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0b2d324e4063100bb30851dc221034d5caab9c1a80c5164ef23dd38e81ed8614f80b901e2f6f307cfd739b4a6481b1146575c340671a8a8a8b35ab01def9ed9
|
7
|
+
data.tar.gz: 0fcb12355a628464d748e191068b67c3e7c09aac0ce3088c70fc3fb3409d55dd54bc2f5d877e871283c6296ea475533ecf69759876f0e84ddf9fe42d30866b04
|
data/bin/git_ownership_insights
CHANGED
@@ -172,14 +172,18 @@ def contribution_message(directory_path:, duration_in_days:, begin_time:, debug:
|
|
172
172
|
end_date = begin_time.to_time.to_i
|
173
173
|
file_count = `git ls-tree -r --name-only $(git rev-list -1 --since="#{start_date}" --until="#{end_date}" HEAD) -- "#{directory_path}" | wc -l`.to_i
|
174
174
|
all_files_with_changes = `git log --name-only --pretty=format:"" --since="#{start_date}" --until="#{end_date}" "#{directory_path}"`.split.sort
|
175
|
-
excluded_patterns = EXCLUDED_FILES.split(',')
|
175
|
+
excluded_patterns = EXCLUDED_FILES.split(',') if EXCLUDED_FILES
|
176
176
|
|
177
177
|
code_files_with_changes = all_files_with_changes.select {|f|
|
178
178
|
extension = File.extname(f)
|
179
179
|
valid_extensions = CODE_EXTENSIONS
|
180
180
|
valid_extensions.include?(extension)
|
181
|
-
}
|
182
|
-
|
181
|
+
}
|
182
|
+
|
183
|
+
if EXCLUDED_FILES
|
184
|
+
code_files_with_changes = code_files_with_changes.reject do |file|
|
185
|
+
excluded_patterns.any? { |pattern| file.include?(pattern) }
|
186
|
+
end
|
183
187
|
end
|
184
188
|
|
185
189
|
uniq_code_files_with_changes = code_files_with_changes.uniq
|