code_ownership 1.38.1 → 1.38.3

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: 8319ea8a2a73ecec20a28193627b25b877ae9983b206dae6ff9422d5be157625
4
- data.tar.gz: 13228207fa0b9042fe5f87e53c80234e862a476ef4a3888bce7f4bbdfb64e970
3
+ metadata.gz: 86cc006408577cb291e5cae787205ef670ebd45afd3ad1bab635e93424c44301
4
+ data.tar.gz: ecea75fa9aa68c9727210a70a1583d0fcb28d17df53e8b35f93942647be6e148
5
5
  SHA512:
6
- metadata.gz: a80e615b1d6e7cc8ec795a7b2ffdb20f0ffb8b0e8027cd70e8361542ff5650f195fca4fdf4ece8e0f1331e987dcef9e2d1106c7125925a43d16403e6e9ed0a78
7
- data.tar.gz: 8fabc79d074c2491c49a3cdc1b0caf24f009dbab3e81b7cdcb84ac4b6d563d6ac7e32c83ec6494a3df81d8293afa01c7674e87b0b05878515177e757a4df0fe3
6
+ metadata.gz: f60e4882e6a0ee4647fec6bd9e193dc8a37d7de5b93f382bc6ef1ac4b870fdb73da9bc356f8618fe49655ac157ddb9167997d0c5c62eaf97dcc3080327ec7319
7
+ data.tar.gz: c37a8274092d7c482610debcee97e4ed1883373297d0a5cff556fc4167494a6e474203ea81977bd4fa39ea652aebd25f0213791a58a7024f616c2d0a44cf6d36
data/README.md CHANGED
@@ -164,6 +164,8 @@ bin/codeownership for_team 'My Team' > tmp/ownership_report.md
164
164
 
165
165
  A `CODEOWNERS` file defines who owns specific files or paths in a repository. When you run `bin/codeownership validate`, a `.github/CODEOWNERS` file will automatically be generated and updated.
166
166
 
167
+ If `codeowners_path` is set in `code_ownership.yml` codeowners will use that path to generate the `CODEOWNERS` file. For example, `codeowners_path: docs` will generate `docs/CODEOWNERS`.
168
+
167
169
  ## Proper Configuration & Validation
168
170
 
169
171
  CodeOwnership comes with a validation function to ensure the following things are true:
@@ -12,6 +12,7 @@ module CodeOwnership
12
12
  const :skip_codeowners_validation, T::Boolean
13
13
  const :raw_hash, T::Hash[T.untyped, T.untyped]
14
14
  const :require_github_teams, T::Boolean
15
+ const :codeowners_path, String
15
16
 
16
17
  sig { returns(Configuration) }
17
18
  def self.fetch
@@ -29,7 +30,8 @@ module CodeOwnership
29
30
  js_package_paths: js_package_paths(config_hash),
30
31
  skip_codeowners_validation: config_hash.fetch('skip_codeowners_validation', false),
31
32
  raw_hash: config_hash,
32
- require_github_teams: config_hash.fetch('require_github_teams', false)
33
+ require_github_teams: config_hash.fetch('require_github_teams', false),
34
+ codeowners_path: config_hash.fetch('codeowners_path', '.github'),
33
35
  )
34
36
  end
35
37
 
@@ -111,7 +111,10 @@ module CodeOwnership
111
111
 
112
112
  sig { returns(Pathname) }
113
113
  def self.path
114
- Pathname.pwd.join('.github/CODEOWNERS')
114
+ Pathname.pwd.join(
115
+ CodeOwnership.configuration.codeowners_path,
116
+ 'CODEOWNERS'
117
+ )
115
118
  end
116
119
 
117
120
  sig { params(files: T::Array[String]).void }
@@ -136,13 +136,23 @@ module CodeOwnership
136
136
  #
137
137
  # ./app/controllers/some_controller.rb:43:in `block (3 levels) in create'
138
138
  #
139
- backtrace_line = %r{\A(#{Pathname.pwd}/|\./)?
140
- (?<file>.+) # Matches 'app/controllers/some_controller.rb'
141
- :
142
- (?<line>\d+) # Matches '43'
143
- :in\s
144
- `(?<function>.*)' # Matches "`block (3 levels) in create'"
145
- \z}x
139
+ backtrace_line = if RUBY_VERSION >= '3.4.0'
140
+ %r{\A(#{Pathname.pwd}/|\./)?
141
+ (?<file>.+) # Matches 'app/controllers/some_controller.rb'
142
+ :
143
+ (?<line>\d+) # Matches '43'
144
+ :in\s
145
+ '(?<function>.*)' # Matches "`block (3 levels) in create'"
146
+ \z}x
147
+ else
148
+ %r{\A(#{Pathname.pwd}/|\./)?
149
+ (?<file>.+) # Matches 'app/controllers/some_controller.rb'
150
+ :
151
+ (?<line>\d+) # Matches '43'
152
+ :in\s
153
+ `(?<function>.*)' # Matches "`block (3 levels) in create'"
154
+ \z}x
155
+ end
146
156
 
147
157
  backtrace.lazy.filter_map do |line|
148
158
  match = line.match(backtrace_line)
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: code_ownership
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.38.1
4
+ version: 1.38.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gusto Engineers
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-11-21 00:00:00.000000000 Z
10
+ date: 2025-02-03 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: code_teams
@@ -205,7 +204,6 @@ metadata:
205
204
  source_code_uri: https://github.com/rubyatscale/code_ownership
206
205
  changelog_uri: https://github.com/rubyatscale/code_ownership/releases
207
206
  allowed_push_host: https://rubygems.org
208
- post_install_message:
209
207
  rdoc_options: []
210
208
  require_paths:
211
209
  - lib
@@ -220,8 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
220
218
  - !ruby/object:Gem::Version
221
219
  version: '0'
222
220
  requirements: []
223
- rubygems_version: 3.5.22
224
- signing_key:
221
+ rubygems_version: 3.6.2
225
222
  specification_version: 4
226
223
  summary: A gem to help engineering teams declare ownership of code
227
224
  test_files: []