code_ownership 1.32.9 → 1.32.10

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: 71768f254f9fbb891679c002c16c20bd70a2125460e3c66995821cfe2784fe56
4
- data.tar.gz: ce5698b1505d306026f807a142f648942ea06d3ab65576d05c623f6bdbdc1dfa
3
+ metadata.gz: e0713332aa7dacd9ec6f097bba250555cb25208f594fd08bfba4a4ecf951d06b
4
+ data.tar.gz: aa039e732cfa8aad7a16439bc2608f51c043eef2f9b642513a7616b95b319c01
5
5
  SHA512:
6
- metadata.gz: 7b2e5da9f4e02b4db10c47be40b1b4bce33f7c44ad18797ff326a6e245f5dc57b2a8534c74fde74a1966970720a9bedf50d59858923e07f64d8e21d9f8411df1
7
- data.tar.gz: b08f25b9008d86b19207931cb44c13adea814b998af8700b1fa445ad09e48e6549f86d6e4b75db41e5a783bf080ea5e25371d97db5307de8c5451bcd3d4fe3da
6
+ metadata.gz: 1c7b7a855b051aa6c856f39144e17484180fa6ff530ec7af3b7870ebf4cbf61b5b33c1a17d2402a319d784a7a17d7b226b64542c65a002707bb87419e1a660dd
7
+ data.tar.gz: b91f701455620e4fe27f2a99b20b58f6b03d78fa04d66548d3f85b1e4202cdf9c09ec2b53a454a3bca419d33b65150c5c24977e9eca93efc102c25e36df21303
@@ -18,8 +18,6 @@ module CodeOwnership
18
18
  extend T::Sig
19
19
  include Mapper
20
20
 
21
- @@map_files_to_owners = T.let({}, T.nilable(T::Hash[String, ::CodeTeams::Team])) # rubocop:disable Style/ClassVars
22
-
23
21
  TEAM_PATTERN = T.let(/\A(?:#|\/\/) @team (?<team>.*)\Z/.freeze, Regexp)
24
22
  DESCRIPTION = 'Annotations at the top of file'
25
23
 
@@ -37,9 +35,7 @@ module CodeOwnership
37
35
  returns(T::Hash[String, ::CodeTeams::Team])
38
36
  end
39
37
  def globs_to_owner(files)
40
- return @@map_files_to_owners if @@map_files_to_owners&.keys && @@map_files_to_owners.keys.count > 0
41
-
42
- @@map_files_to_owners = files.each_with_object({}) do |filename_relative_to_root, mapping| # rubocop:disable Style/ClassVars
38
+ files.each_with_object({}) do |filename_relative_to_root, mapping| # rubocop:disable Style/ClassVars
43
39
  owner = file_annotation_based_owner(filename_relative_to_root)
44
40
  next unless owner
45
41
 
@@ -119,7 +115,6 @@ module CodeOwnership
119
115
 
120
116
  sig { override.void }
121
117
  def bust_caches!
122
- @@map_files_to_owners = {} # rubocop:disable Style/ClassVars
123
118
  end
124
119
  end
125
120
  end
@@ -9,8 +9,6 @@ module CodeOwnership
9
9
  extend T::Sig
10
10
  include Mapper
11
11
 
12
- @@package_yml_cache = T.let({}, T::Hash[String, T.nilable(Packs::Pack)]) # rubocop:disable Style/ClassVars
13
-
14
12
  sig do
15
13
  override.params(file: String).
16
14
  returns(T.nilable(::CodeTeams::Team))
@@ -69,7 +67,6 @@ module CodeOwnership
69
67
 
70
68
  sig { override.void }
71
69
  def bust_caches!
72
- @@package_yml_cache = {} # rubocop:disable Style/ClassVars
73
70
  end
74
71
  end
75
72
  end
@@ -12,8 +12,6 @@ module CodeOwnership
12
12
 
13
13
  @@map_files_to_owners = T.let(@map_files_to_owners, T.nilable(T::Hash[String, ::CodeTeams::Team])) # rubocop:disable Style/ClassVars
14
14
  @@map_files_to_owners = {} # rubocop:disable Style/ClassVars
15
- @@codeowners_lines_to_owners = T.let(@codeowners_lines_to_owners, T.nilable(T::Hash[String, ::CodeTeams::Team])) # rubocop:disable Style/ClassVars
16
- @@codeowners_lines_to_owners = {} # rubocop:disable Style/ClassVars
17
15
 
18
16
  sig do
19
17
  params(files: T::Array[String]).
@@ -103,9 +101,7 @@ module CodeOwnership
103
101
  returns(T::Hash[String, ::CodeTeams::Team])
104
102
  end
105
103
  def globs_to_owner(files)
106
- return @@codeowners_lines_to_owners if @@codeowners_lines_to_owners&.keys && @@codeowners_lines_to_owners.keys.count > 0
107
-
108
- @@codeowners_lines_to_owners = CodeTeams.all.each_with_object({}) do |team, map| # rubocop:disable Style/ClassVars
104
+ CodeTeams.all.each_with_object({}) do |team, map| # rubocop:disable Style/ClassVars
109
105
  TeamPlugins::Ownership.for(team).owned_globs.each do |owned_glob|
110
106
  map[owned_glob] = team
111
107
  end
@@ -114,7 +110,6 @@ module CodeOwnership
114
110
 
115
111
  sig { override.void }
116
112
  def bust_caches!
117
- @@codeowners_lines_to_owners = {} # rubocop:disable Style/ClassVars
118
113
  @@map_files_to_owners = {} # rubocop:disable Style/ClassVars
119
114
  end
120
115
 
@@ -11,8 +11,6 @@ module CodeOwnership
11
11
 
12
12
  @@map_files_to_owners = T.let(@map_files_to_owners, T.nilable(T::Hash[String, ::CodeTeams::Team])) # rubocop:disable Style/ClassVars
13
13
  @@map_files_to_owners = {} # rubocop:disable Style/ClassVars
14
- @@codeowners_lines_to_owners = T.let(@codeowners_lines_to_owners, T.nilable(T::Hash[String, ::CodeTeams::Team])) # rubocop:disable Style/ClassVars
15
- @@codeowners_lines_to_owners = {} # rubocop:disable Style/ClassVars
16
14
 
17
15
  sig do
18
16
  params(files: T::Array[String]).
@@ -39,16 +37,13 @@ module CodeOwnership
39
37
  returns(T::Hash[String, ::CodeTeams::Team])
40
38
  end
41
39
  def globs_to_owner(files)
42
- return @@codeowners_lines_to_owners if @@codeowners_lines_to_owners&.keys && @@codeowners_lines_to_owners.keys.count > 0
43
-
44
- @@codeowners_lines_to_owners = CodeTeams.all.each_with_object({}) do |team, map| # rubocop:disable Style/ClassVars
40
+ CodeTeams.all.each_with_object({}) do |team, map| # rubocop:disable Style/ClassVars
45
41
  map[team.config_yml] = team
46
42
  end
47
43
  end
48
44
 
49
45
  sig { override.void }
50
46
  def bust_caches!
51
- @@codeowners_lines_to_owners = {} # rubocop:disable Style/ClassVars
52
47
  @@map_files_to_owners = {} # rubocop:disable Style/ClassVars
53
48
  end
54
49
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: code_ownership
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.32.9
4
+ version: 1.32.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gusto Engineers
@@ -53,7 +53,7 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: rake
56
+ name: pry
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: pry
70
+ name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="