git_ownership_insights 1.0.8 → 1.1.0

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: 67339ef0ad157a4b396b000fba31d443dbc938a24019a7bd98d1a3fe4c4a80c7
4
- data.tar.gz: 9ccdb62fe54aefb9c1ee348d831a584a4c83465b5e4cc07fc50be1ba5221b8e6
3
+ metadata.gz: 6b4e4cc30ba7171927e4abab4be4b0193352393d3690f0f687c4ac87518bc72c
4
+ data.tar.gz: 55ea9d63840f6d95bb5d4f071f712ca76f79b666d50f21b162a05b97a9adb47a
5
5
  SHA512:
6
- metadata.gz: 0a61138e4efd95f389684f0bbbe79478af6c2e020365d1cbb54aa6bdd5f696e096939a85a66f8c215909dcb20d095ec839ee21573e17bbd1cd1d4c1f4121cb71
7
- data.tar.gz: 7e242a2bd0bbbfbe42b7d8732e4ffb85fe92025e3f5a65509a0689dc31ab41baa096886ba8c068636f7b4e743667ca779c275822a1a5f43186a197ed5d4c4be7
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 = ['.swift', '.kt']
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 = ['.swift', '.kt']
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.select do |f|
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|
@@ -158,8 +160,8 @@ module GitOwnershipInsights
158
160
  puts "*Timeframe:* #{(begin_time - duration_in_days).strftime('%Y-%m-%d')} to #{begin_time.strftime('%Y-%m-%d')}"
159
161
  puts " *Hotspot Code Changes:* #{churn_count} (#{hotspot_changes_percentage.round(2)}%)"
160
162
  puts " *Cross-Squad Dependency:*"
161
- puts " *Squads depending on each other occurrences:* #{cross_teams_count}"
162
- puts " *Squads with single responsibility:* #{single_ownership_teams_count}"
163
+ puts " *Contributions by multiple squads to the same files:* #{cross_teams_count}"
164
+ puts " *Contributions by single squads contributing to single files:* #{single_ownership_teams_count}"
163
165
  puts " *Files exceeding #{BIG_FILE_SIZE} lines with multiple contributors:* #{filtered_top_touched_files.count}"
164
166
  count_hotspot_lines(filtered_files.keys)
165
167
  count_big_files(directory_path)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GitOwnershipInsights
4
- VERSION = '1.0.8'
4
+ VERSION = '1.1.0'
5
5
  end
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.8
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-24 00:00:00.000000000 Z
11
+ date: 2024-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: date