code_ownership 1.27.0 → 1.28.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -6
- data/lib/code_ownership/private/ownership_mappers/file_annotations.rb +5 -5
- data/lib/code_ownership/private/ownership_mappers/interface.rb +3 -3
- data/lib/code_ownership/private/ownership_mappers/js_package_ownership.rb +4 -4
- data/lib/code_ownership/private/ownership_mappers/package_ownership.rb +4 -4
- data/lib/code_ownership/private/ownership_mappers/team_globs.rb +7 -7
- data/lib/code_ownership/private/team_plugins/github.rb +1 -1
- data/lib/code_ownership/private/team_plugins/ownership.rb +1 -1
- data/lib/code_ownership/private/validations/github_codeowners_up_to_date.rb +1 -1
- data/lib/code_ownership/private.rb +4 -4
- data/lib/code_ownership.rb +8 -8
- data/sorbet/rbi/gems/{bigrails-teams@0.1.0.rbi → code_teams@1.0.0.rbi} +25 -25
- metadata +12 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d73cb8995d6430d05780252417863b38bd14a461bf8f3afe4b9724abb407efea
|
4
|
+
data.tar.gz: 7cc3c3c4a2968b8e3a265f990c28395b0c4e6163b7ba48ad2b0c8be64123990c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f2a2c2331aa980b414343e54429ba3ab367fa6a38cdad44811b84193afd8a6d3846baf77ae8b7cd78a2754b65865b5799644382ff5182ba0439bb3cb3884cf6
|
7
|
+
data.tar.gz: d0ecc33dd542a3dc606caceb52fb38ed32743a12076f5253b96a2c2c6b7fa24a0b1445df6d1a41878ef350a87fe5075cbb17ebc5bb3964211cbac18ee005bfd5
|
data/README.md
CHANGED
@@ -5,7 +5,7 @@ Check out `lib/code_ownership.rb` to see the public API.
|
|
5
5
|
|
6
6
|
Check out `code_ownership_spec.rb` to see examples of how code ownership is used.
|
7
7
|
|
8
|
-
There is also a [companion VSCode Extension]([url](https://github.com/
|
8
|
+
There is also a [companion VSCode Extension]([url](https://github.com/rubyatscale/code-ownership-vscode)) for this gem. Just search `Gusto.code-ownership-vscode` in the VSCode Extension Marketplace.
|
9
9
|
|
10
10
|
## Usage: Declaring Ownership
|
11
11
|
There are three ways to declare code ownership using this gem.
|
@@ -19,7 +19,7 @@ metadata:
|
|
19
19
|
```
|
20
20
|
|
21
21
|
### Glob-Based Ownership
|
22
|
-
In your team's configured YML (see [`
|
22
|
+
In your team's configured YML (see [`code_teams`](https://github.com/rubyatscale/code_teams)), you can set `owned_globs` to be a glob of files your team owns. For example, in `my_team.yml`:
|
23
23
|
```yml
|
24
24
|
name: My Team
|
25
25
|
owned_globs:
|
@@ -33,7 +33,7 @@ File annotations are a last resort if there is no clear home for your code. File
|
|
33
33
|
```
|
34
34
|
## Usage: Reading CodeOwnership
|
35
35
|
### `for_file`
|
36
|
-
`CodeOwnership.for_file`, given a relative path to a file returns a `
|
36
|
+
`CodeOwnership.for_file`, given a relative path to a file returns a `CodeTeams::Team` if there is a team that owns the file, `nil` otherwise.
|
37
37
|
|
38
38
|
```ruby
|
39
39
|
CodeOwnership.for_file('path/to/file/relative/to/application/root.rb')
|
@@ -44,7 +44,7 @@ Contributor note: If you are making updates to this method or the methods gettin
|
|
44
44
|
See `code_ownership_spec.rb` for examples.
|
45
45
|
|
46
46
|
### `for_backtrace`
|
47
|
-
`CodeOwnership.for_backtrace` can be given a backtrace and will either return `nil`, or a `
|
47
|
+
`CodeOwnership.for_backtrace` can be given a backtrace and will either return `nil`, or a `CodeTeams::Team`.
|
48
48
|
|
49
49
|
```ruby
|
50
50
|
CodeOwnership.for_backtrace(exception.backtrace)
|
@@ -56,7 +56,7 @@ See `code_ownership_spec.rb` for an example.
|
|
56
56
|
|
57
57
|
### `for_class`
|
58
58
|
|
59
|
-
`CodeOwnership.for_class` can be given a class and will either return `nil`, or a `
|
59
|
+
`CodeOwnership.for_class` can be given a class and will either return `nil`, or a `CodeTeams::Team`.
|
60
60
|
|
61
61
|
```ruby
|
62
62
|
CodeOwnership.for_class(MyClass.name)
|
@@ -73,7 +73,7 @@ A `CODEOWNERS` file defines who owns specific files or paths in a repository. Wh
|
|
73
73
|
## Proper Configuration & Validation
|
74
74
|
CodeOwnership comes with a validation function to ensure the following things are true:
|
75
75
|
1) Only one mechanism is defining file ownership. That is -- you can't have a file annotation on a file owned via package-based or glob-based ownership. This helps make ownership behavior more clear by avoiding concerns about precedence.
|
76
|
-
2) All teams referenced as an owner for any file or package is a valid team (i.e. it's in the list of `
|
76
|
+
2) All teams referenced as an owner for any file or package is a valid team (i.e. it's in the list of `CodeTeams.all`).
|
77
77
|
3) All files have ownership. You can specify in `unowned_globs` to represent a TODO list of files to add ownership to.
|
78
78
|
3) The `.github/CODEOWNERS` file is up to date. This is automatically corrected and staged unless specified otherwise with `bin/codeownership validate --skip-autocorrect --skip-stage`. You can turn this validation off by setting `skip_codeowners_validation: true` in `code_ownership.yml`.
|
79
79
|
|
@@ -18,13 +18,13 @@ module CodeOwnership
|
|
18
18
|
extend T::Sig
|
19
19
|
include Interface
|
20
20
|
|
21
|
-
@@map_files_to_owners = T.let({}, T.nilable(T::Hash[String, T.nilable(::
|
21
|
+
@@map_files_to_owners = T.let({}, T.nilable(T::Hash[String, T.nilable(::CodeTeams::Team)])) # rubocop:disable Style/ClassVars
|
22
22
|
|
23
23
|
TEAM_PATTERN = T.let(/\A(?:#|\/\/) @team (?<team>.*)\Z/.freeze, Regexp)
|
24
24
|
|
25
25
|
sig do
|
26
26
|
override.params(file: String).
|
27
|
-
returns(T.nilable(::
|
27
|
+
returns(T.nilable(::CodeTeams::Team))
|
28
28
|
end
|
29
29
|
def map_file_to_owner(file)
|
30
30
|
file_annotation_based_owner(file)
|
@@ -33,7 +33,7 @@ module CodeOwnership
|
|
33
33
|
sig do
|
34
34
|
override.
|
35
35
|
params(files: T::Array[String]).
|
36
|
-
returns(T::Hash[String, T.nilable(::
|
36
|
+
returns(T::Hash[String, T.nilable(::CodeTeams::Team)])
|
37
37
|
end
|
38
38
|
def map_files_to_owners(files)
|
39
39
|
return @@map_files_to_owners if @@map_files_to_owners&.keys && @@map_files_to_owners.keys.count > 0
|
@@ -46,7 +46,7 @@ module CodeOwnership
|
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
|
-
sig { params(filename: String).returns(T.nilable(
|
49
|
+
sig { params(filename: String).returns(T.nilable(CodeTeams::Team)) }
|
50
50
|
def file_annotation_based_owner(filename)
|
51
51
|
# If for a directory is named with an ownable extension, we need to skip
|
52
52
|
# so File.foreach doesn't blow up below. This was needed because Cypress
|
@@ -97,7 +97,7 @@ module CodeOwnership
|
|
97
97
|
end
|
98
98
|
|
99
99
|
sig do
|
100
|
-
override.returns(T::Hash[String, T.nilable(::
|
100
|
+
override.returns(T::Hash[String, T.nilable(::CodeTeams::Team)])
|
101
101
|
end
|
102
102
|
def codeowners_lines_to_owners
|
103
103
|
@@map_files_to_owners = nil # rubocop:disable Style/ClassVars
|
@@ -16,7 +16,7 @@ module CodeOwnership
|
|
16
16
|
#
|
17
17
|
sig do
|
18
18
|
abstract.params(file: String).
|
19
|
-
returns(T.nilable(::
|
19
|
+
returns(T.nilable(::CodeTeams::Team))
|
20
20
|
end
|
21
21
|
def map_file_to_owner(file)
|
22
22
|
end
|
@@ -26,13 +26,13 @@ module CodeOwnership
|
|
26
26
|
#
|
27
27
|
sig do
|
28
28
|
abstract.params(files: T::Array[String]).
|
29
|
-
returns(T::Hash[String, T.nilable(::
|
29
|
+
returns(T::Hash[String, T.nilable(::CodeTeams::Team)])
|
30
30
|
end
|
31
31
|
def map_files_to_owners(files)
|
32
32
|
end
|
33
33
|
|
34
34
|
sig do
|
35
|
-
abstract.returns(T::Hash[String, T.nilable(::
|
35
|
+
abstract.returns(T::Hash[String, T.nilable(::CodeTeams::Team)])
|
36
36
|
end
|
37
37
|
def codeowners_lines_to_owners
|
38
38
|
end
|
@@ -13,7 +13,7 @@ module CodeOwnership
|
|
13
13
|
|
14
14
|
sig do
|
15
15
|
override.params(file: String).
|
16
|
-
returns(T.nilable(::
|
16
|
+
returns(T.nilable(::CodeTeams::Team))
|
17
17
|
end
|
18
18
|
def map_file_to_owner(file)
|
19
19
|
package = map_file_to_relevant_package(file)
|
@@ -26,7 +26,7 @@ module CodeOwnership
|
|
26
26
|
sig do
|
27
27
|
override.
|
28
28
|
params(files: T::Array[String]).
|
29
|
-
returns(T::Hash[String, T.nilable(::
|
29
|
+
returns(T::Hash[String, T.nilable(::CodeTeams::Team)])
|
30
30
|
end
|
31
31
|
def map_files_to_owners(files) # rubocop:disable Lint/UnusedMethodArgument
|
32
32
|
ParseJsPackages.all.each_with_object({}) do |package, res|
|
@@ -49,7 +49,7 @@ module CodeOwnership
|
|
49
49
|
# subset of files, but rather we want code ownership for all files.
|
50
50
|
#
|
51
51
|
sig do
|
52
|
-
override.returns(T::Hash[String, T.nilable(::
|
52
|
+
override.returns(T::Hash[String, T.nilable(::CodeTeams::Team)])
|
53
53
|
end
|
54
54
|
def codeowners_lines_to_owners
|
55
55
|
ParseJsPackages.all.each_with_object({}) do |package, res|
|
@@ -65,7 +65,7 @@ module CodeOwnership
|
|
65
65
|
'Owner metadata key in package.json'
|
66
66
|
end
|
67
67
|
|
68
|
-
sig { params(package: ParseJsPackages::Package).returns(T.nilable(
|
68
|
+
sig { params(package: ParseJsPackages::Package).returns(T.nilable(CodeTeams::Team)) }
|
69
69
|
def owner_for_package(package)
|
70
70
|
raw_owner_value = package.metadata['owner']
|
71
71
|
return nil if !raw_owner_value
|
@@ -13,7 +13,7 @@ module CodeOwnership
|
|
13
13
|
|
14
14
|
sig do
|
15
15
|
override.params(file: String).
|
16
|
-
returns(T.nilable(::
|
16
|
+
returns(T.nilable(::CodeTeams::Team))
|
17
17
|
end
|
18
18
|
def map_file_to_owner(file)
|
19
19
|
package = map_file_to_relevant_package(file)
|
@@ -26,7 +26,7 @@ module CodeOwnership
|
|
26
26
|
sig do
|
27
27
|
override.
|
28
28
|
params(files: T::Array[String]).
|
29
|
-
returns(T::Hash[String, T.nilable(::
|
29
|
+
returns(T::Hash[String, T.nilable(::CodeTeams::Team)])
|
30
30
|
end
|
31
31
|
def map_files_to_owners(files) # rubocop:disable Lint/UnusedMethodArgument
|
32
32
|
ParsePackwerk.all.each_with_object({}) do |package, res|
|
@@ -49,7 +49,7 @@ module CodeOwnership
|
|
49
49
|
# subset of files, but rather we want code ownership for all files.
|
50
50
|
#
|
51
51
|
sig do
|
52
|
-
override.returns(T::Hash[String, T.nilable(::
|
52
|
+
override.returns(T::Hash[String, T.nilable(::CodeTeams::Team)])
|
53
53
|
end
|
54
54
|
def codeowners_lines_to_owners
|
55
55
|
ParsePackwerk.all.each_with_object({}) do |package, res|
|
@@ -65,7 +65,7 @@ module CodeOwnership
|
|
65
65
|
'Owner metadata key in package.yml'
|
66
66
|
end
|
67
67
|
|
68
|
-
sig { params(package: ParsePackwerk::Package).returns(T.nilable(
|
68
|
+
sig { params(package: ParsePackwerk::Package).returns(T.nilable(CodeTeams::Team)) }
|
69
69
|
def owner_for_package(package)
|
70
70
|
raw_owner_value = package.metadata['owner']
|
71
71
|
return nil if !raw_owner_value
|
@@ -9,20 +9,20 @@ module CodeOwnership
|
|
9
9
|
extend T::Sig
|
10
10
|
include Interface
|
11
11
|
|
12
|
-
@@map_files_to_owners = T.let(@map_files_to_owners, T.nilable(T::Hash[String, T.nilable(::
|
12
|
+
@@map_files_to_owners = T.let(@map_files_to_owners, T.nilable(T::Hash[String, T.nilable(::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, T.nilable(::
|
14
|
+
@@codeowners_lines_to_owners = T.let(@codeowners_lines_to_owners, T.nilable(T::Hash[String, T.nilable(::CodeTeams::Team)])) # rubocop:disable Style/ClassVars
|
15
15
|
@@codeowners_lines_to_owners = {} # rubocop:disable Style/ClassVars
|
16
16
|
|
17
17
|
sig do
|
18
18
|
override.
|
19
19
|
params(files: T::Array[String]).
|
20
|
-
returns(T::Hash[String, T.nilable(::
|
20
|
+
returns(T::Hash[String, T.nilable(::CodeTeams::Team)])
|
21
21
|
end
|
22
22
|
def map_files_to_owners(files) # rubocop:disable Lint/UnusedMethodArgument
|
23
23
|
return @@map_files_to_owners if @@map_files_to_owners&.keys && @@map_files_to_owners.keys.count > 0
|
24
24
|
|
25
|
-
@@map_files_to_owners =
|
25
|
+
@@map_files_to_owners = CodeTeams.all.each_with_object({}) do |team, map| # rubocop:disable Style/ClassVars
|
26
26
|
TeamPlugins::Ownership.for(team).owned_globs.each do |glob|
|
27
27
|
Dir.glob(glob).each do |filename|
|
28
28
|
map[filename] = team
|
@@ -33,19 +33,19 @@ module CodeOwnership
|
|
33
33
|
|
34
34
|
sig do
|
35
35
|
override.params(file: String).
|
36
|
-
returns(T.nilable(::
|
36
|
+
returns(T.nilable(::CodeTeams::Team))
|
37
37
|
end
|
38
38
|
def map_file_to_owner(file)
|
39
39
|
map_files_to_owners([file])[file]
|
40
40
|
end
|
41
41
|
|
42
42
|
sig do
|
43
|
-
override.returns(T::Hash[String, T.nilable(::
|
43
|
+
override.returns(T::Hash[String, T.nilable(::CodeTeams::Team)])
|
44
44
|
end
|
45
45
|
def codeowners_lines_to_owners
|
46
46
|
return @@codeowners_lines_to_owners if @@codeowners_lines_to_owners&.keys && @@codeowners_lines_to_owners.keys.count > 0
|
47
47
|
|
48
|
-
@@codeowners_lines_to_owners =
|
48
|
+
@@codeowners_lines_to_owners = CodeTeams.all.each_with_object({}) do |team, map| # rubocop:disable Style/ClassVars
|
49
49
|
TeamPlugins::Ownership.for(team).owned_globs.each do |owned_glob|
|
50
50
|
map[owned_glob] = team
|
51
51
|
end
|
@@ -98,7 +98,7 @@ module CodeOwnership
|
|
98
98
|
# https://help.github.com/articles/about-codeowners/
|
99
99
|
sig { returns(T::Array[String]) }
|
100
100
|
def codeowners_file_lines
|
101
|
-
github_team_map =
|
101
|
+
github_team_map = CodeTeams.all.each_with_object({}) do |team, map|
|
102
102
|
team_github = TeamPlugins::Github.for(team).github
|
103
103
|
next if team_github.do_not_add_to_codeowners_file
|
104
104
|
|
@@ -50,7 +50,7 @@ module CodeOwnership
|
|
50
50
|
end
|
51
51
|
|
52
52
|
if errors.any?
|
53
|
-
errors << 'See https://github.com/
|
53
|
+
errors << 'See https://github.com/rubyatscale/code_ownership#README.md for more details'
|
54
54
|
raise InvalidCodeOwnershipConfigurationError.new(errors.join("\n")) # rubocop:disable Style/RaiseArgs
|
55
55
|
end
|
56
56
|
end
|
@@ -92,11 +92,11 @@ module CodeOwnership
|
|
92
92
|
@tracked_files ||= Dir.glob(configuration.owned_globs)
|
93
93
|
end
|
94
94
|
|
95
|
-
sig { params(team_name: String, location_of_reference: String).returns(
|
95
|
+
sig { params(team_name: String, location_of_reference: String).returns(CodeTeams::Team) }
|
96
96
|
def self.find_team!(team_name, location_of_reference)
|
97
|
-
found_team =
|
97
|
+
found_team = CodeTeams.find(team_name)
|
98
98
|
if found_team.nil?
|
99
|
-
raise StandardError, "Could not find team with name: `#{team_name}` in #{location_of_reference}. Make sure the team is one of `#{
|
99
|
+
raise StandardError, "Could not find team with name: `#{team_name}` in #{location_of_reference}. Make sure the team is one of `#{CodeTeams.all.map(&:name).sort}`"
|
100
100
|
else
|
101
101
|
found_team
|
102
102
|
end
|
data/lib/code_ownership.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
# typed: strict
|
4
4
|
|
5
5
|
require 'set'
|
6
|
-
require '
|
6
|
+
require 'code_teams'
|
7
7
|
require 'sorbet-runtime'
|
8
8
|
require 'json'
|
9
9
|
require 'parse_packwerk'
|
@@ -17,15 +17,15 @@ module CodeOwnership
|
|
17
17
|
|
18
18
|
requires_ancestor { Kernel }
|
19
19
|
|
20
|
-
sig { params(file: String).returns(T.nilable(
|
20
|
+
sig { params(file: String).returns(T.nilable(CodeTeams::Team)) }
|
21
21
|
def for_file(file)
|
22
|
-
@for_file ||= T.let(@for_file, T.nilable(T::Hash[String, T.nilable(
|
22
|
+
@for_file ||= T.let(@for_file, T.nilable(T::Hash[String, T.nilable(CodeTeams::Team)]))
|
23
23
|
@for_file ||= {}
|
24
24
|
|
25
25
|
return nil if file.start_with?('./')
|
26
26
|
return @for_file[file] if @for_file.key?(file)
|
27
27
|
|
28
|
-
owner = T.let(nil, T.nilable(
|
28
|
+
owner = T.let(nil, T.nilable(CodeTeams::Team))
|
29
29
|
|
30
30
|
Private.mappers.each do |mapper|
|
31
31
|
owner = mapper.map_file_to_owner(file)
|
@@ -61,7 +61,7 @@ module CodeOwnership
|
|
61
61
|
|
62
62
|
# Given a backtrace from either `Exception#backtrace` or `caller`, find the
|
63
63
|
# first line that corresponds to a file with assigned ownership
|
64
|
-
sig { params(backtrace: T.nilable(T::Array[String]), excluded_teams: T::Array[::
|
64
|
+
sig { params(backtrace: T.nilable(T::Array[String]), excluded_teams: T::Array[::CodeTeams::Team]).returns(T.nilable(::CodeTeams::Team)) }
|
65
65
|
def for_backtrace(backtrace, excluded_teams: [])
|
66
66
|
return unless backtrace
|
67
67
|
|
@@ -93,9 +93,9 @@ module CodeOwnership
|
|
93
93
|
nil
|
94
94
|
end
|
95
95
|
|
96
|
-
sig { params(klass: T.nilable(T.any(Class, Module))).returns(T.nilable(::
|
96
|
+
sig { params(klass: T.nilable(T.any(Class, Module))).returns(T.nilable(::CodeTeams::Team)) }
|
97
97
|
def for_class(klass)
|
98
|
-
@memoized_values ||= T.let(@memoized_values, T.nilable(T::Hash[String, T.nilable(::
|
98
|
+
@memoized_values ||= T.let(@memoized_values, T.nilable(T::Hash[String, T.nilable(::CodeTeams::Team)]))
|
99
99
|
@memoized_values ||= {}
|
100
100
|
# We use key because the memoized value could be `nil`
|
101
101
|
if !@memoized_values.key?(klass.to_s)
|
@@ -110,7 +110,7 @@ module CodeOwnership
|
|
110
110
|
end
|
111
111
|
end
|
112
112
|
|
113
|
-
sig { params(package: ParsePackwerk::Package).returns(T.nilable(::
|
113
|
+
sig { params(package: ParsePackwerk::Package).returns(T.nilable(::CodeTeams::Team)) }
|
114
114
|
def for_package(package)
|
115
115
|
Private::OwnershipMappers::PackageOwnership.new.owner_for_package(package)
|
116
116
|
end
|
@@ -1,78 +1,78 @@
|
|
1
1
|
# typed: true
|
2
2
|
|
3
3
|
# DO NOT EDIT MANUALLY
|
4
|
-
# This is an autogenerated file for types exported from the `
|
5
|
-
# Please instead update this file by running `bin/tapioca gem
|
4
|
+
# This is an autogenerated file for types exported from the `code_teams` gem.
|
5
|
+
# Please instead update this file by running `bin/tapioca gem code_teams`.
|
6
6
|
|
7
|
-
module
|
7
|
+
module CodeTeams
|
8
8
|
class << self
|
9
|
-
sig { returns(T::Array[::
|
9
|
+
sig { returns(T::Array[::CodeTeams::Team]) }
|
10
10
|
def all; end
|
11
11
|
|
12
12
|
sig { void }
|
13
13
|
def bust_caches!; end
|
14
14
|
|
15
|
-
sig { params(name: ::String).returns(T.nilable(::
|
15
|
+
sig { params(name: ::String).returns(T.nilable(::CodeTeams::Team)) }
|
16
16
|
def find(name); end
|
17
17
|
|
18
|
-
sig { params(dir: ::String).returns(T::Array[::
|
18
|
+
sig { params(dir: ::String).returns(T::Array[::CodeTeams::Team]) }
|
19
19
|
def for_directory(dir); end
|
20
20
|
|
21
21
|
sig { params(string: ::String).returns(::String) }
|
22
22
|
def tag_value_for(string); end
|
23
23
|
|
24
|
-
sig { params(teams: T::Array[::
|
24
|
+
sig { params(teams: T::Array[::CodeTeams::Team]).returns(T::Array[::String]) }
|
25
25
|
def validation_errors(teams); end
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
class
|
29
|
+
class CodeTeams::IncorrectPublicApiUsageError < ::StandardError; end
|
30
30
|
|
31
|
-
class
|
31
|
+
class CodeTeams::Plugin
|
32
32
|
abstract!
|
33
33
|
|
34
|
-
sig { params(team: ::
|
34
|
+
sig { params(team: ::CodeTeams::Team).void }
|
35
35
|
def initialize(team); end
|
36
36
|
|
37
37
|
class << self
|
38
|
-
sig { returns(T::Array[T.class_of(
|
38
|
+
sig { returns(T::Array[T.class_of(CodeTeams::Plugin)]) }
|
39
39
|
def all_plugins; end
|
40
40
|
|
41
|
-
sig { params(team: ::
|
41
|
+
sig { params(team: ::CodeTeams::Team).returns(T.attached_class) }
|
42
42
|
def for(team); end
|
43
43
|
|
44
44
|
sig { params(base: T.untyped).void }
|
45
45
|
def inherited(base); end
|
46
46
|
|
47
|
-
sig { params(team: ::
|
47
|
+
sig { params(team: ::CodeTeams::Team, key: ::String).returns(::String) }
|
48
48
|
def missing_key_error_message(team, key); end
|
49
49
|
|
50
|
-
sig { params(teams: T::Array[::
|
50
|
+
sig { params(teams: T::Array[::CodeTeams::Team]).returns(T::Array[::String]) }
|
51
51
|
def validation_errors(teams); end
|
52
52
|
|
53
53
|
private
|
54
54
|
|
55
|
-
sig { params(team: ::
|
55
|
+
sig { params(team: ::CodeTeams::Team).returns(T.attached_class) }
|
56
56
|
def register_team(team); end
|
57
57
|
|
58
|
-
sig { returns(T::Hash[T.nilable(::String), T::Hash[::Class, ::
|
58
|
+
sig { returns(T::Hash[T.nilable(::String), T::Hash[::Class, ::CodeTeams::Plugin]]) }
|
59
59
|
def registry; end
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
63
|
-
module
|
63
|
+
module CodeTeams::Plugins; end
|
64
64
|
|
65
|
-
class
|
66
|
-
sig { returns(::
|
65
|
+
class CodeTeams::Plugins::Identity < ::CodeTeams::Plugin
|
66
|
+
sig { returns(::CodeTeams::Plugins::Identity::IdentityStruct) }
|
67
67
|
def identity; end
|
68
68
|
|
69
69
|
class << self
|
70
|
-
sig { override.params(teams: T::Array[::
|
70
|
+
sig { override.params(teams: T::Array[::CodeTeams::Team]).returns(T::Array[::String]) }
|
71
71
|
def validation_errors(teams); end
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
75
|
-
class
|
75
|
+
class CodeTeams::Plugins::Identity::IdentityStruct < ::Struct
|
76
76
|
def name; end
|
77
77
|
def name=(_); end
|
78
78
|
|
@@ -84,7 +84,7 @@ class Teams::Plugins::Identity::IdentityStruct < ::Struct
|
|
84
84
|
end
|
85
85
|
end
|
86
86
|
|
87
|
-
class
|
87
|
+
class CodeTeams::Team
|
88
88
|
sig { params(config_yml: T.nilable(::String), raw_hash: T::Hash[T.untyped, T.untyped]).void }
|
89
89
|
def initialize(config_yml:, raw_hash:); end
|
90
90
|
|
@@ -109,12 +109,12 @@ class Teams::Team
|
|
109
109
|
def to_tag; end
|
110
110
|
|
111
111
|
class << self
|
112
|
-
sig { params(raw_hash: T::Hash[T.untyped, T.untyped]).returns(::
|
112
|
+
sig { params(raw_hash: T::Hash[T.untyped, T.untyped]).returns(::CodeTeams::Team) }
|
113
113
|
def from_hash(raw_hash); end
|
114
114
|
|
115
|
-
sig { params(config_yml: ::String).returns(::
|
115
|
+
sig { params(config_yml: ::String).returns(::CodeTeams::Team) }
|
116
116
|
def from_yml(config_yml); end
|
117
117
|
end
|
118
118
|
end
|
119
119
|
|
120
|
-
|
120
|
+
CodeTeams::UNKNOWN_TEAM_STRING = T.let(T.unsafe(nil), String)
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: code_ownership
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.28.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gusto Engineers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-06-
|
11
|
+
date: 2022-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: code_teams
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
19
|
+
version: '1.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
26
|
+
version: '1.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: parse_packwerk
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -149,17 +149,17 @@ files:
|
|
149
149
|
- lib/code_ownership/private/validations/github_codeowners_up_to_date.rb
|
150
150
|
- lib/code_ownership/private/validations/interface.rb
|
151
151
|
- sorbet/config
|
152
|
-
- sorbet/rbi/gems/
|
152
|
+
- sorbet/rbi/gems/code_teams@1.0.0.rbi
|
153
153
|
- sorbet/rbi/gems/parse_packwerk@0.7.0.rbi
|
154
154
|
- sorbet/rbi/manual.rbi
|
155
155
|
- sorbet/rbi/todo.rbi
|
156
|
-
homepage: https://github.com/
|
156
|
+
homepage: https://github.com/rubyatscale/code_ownership
|
157
157
|
licenses:
|
158
158
|
- MIT
|
159
159
|
metadata:
|
160
|
-
homepage_uri: https://github.com/
|
161
|
-
source_code_uri: https://github.com/
|
162
|
-
changelog_uri: https://github.com/
|
160
|
+
homepage_uri: https://github.com/rubyatscale/code_ownership
|
161
|
+
source_code_uri: https://github.com/rubyatscale/code_ownership
|
162
|
+
changelog_uri: https://github.com/rubyatscale/code_ownership/releases
|
163
163
|
allowed_push_host: https://rubygems.org
|
164
164
|
post_install_message:
|
165
165
|
rdoc_options: []
|